mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2026-01-06 15:52:03 +00:00
fix uniform number
This commit is contained in:
@@ -42,7 +42,7 @@ public class SetCountFunction<T> extends AbstractLootConditionalFunction<T> {
|
||||
@Override
|
||||
public LootFunction<A> create(Map<String, Object> arguments) {
|
||||
Object value = arguments.get("count");
|
||||
boolean add = (boolean) arguments.getOrDefault("add", true);
|
||||
boolean add = (boolean) arguments.getOrDefault("add", false);
|
||||
List<LootCondition> conditions = Optional.ofNullable(arguments.get("conditions"))
|
||||
.map(it -> LootConditions.fromMapList((List<Map<String, Object>>) it))
|
||||
.orElse(Collections.emptyList());
|
||||
|
||||
@@ -17,7 +17,7 @@ public class UniformNumberProvider implements NumberProvider {
|
||||
|
||||
@Override
|
||||
public int getInt(LootContext context) {
|
||||
return context.randomSource().nextInt(this.min.getInt(context), this.max.getInt(context));
|
||||
return context.randomSource().nextInt(this.min.getInt(context), this.max.getInt(context) + 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user