9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-19 15:09:15 +00:00

fix uniform number

This commit is contained in:
XiaoMoMi
2025-03-15 17:52:16 +08:00
parent e1683b422e
commit 24f9ed9644
4 changed files with 5 additions and 3 deletions

View File

@@ -44,6 +44,8 @@ resource-pack:
# Please add the ignored textures/models/sounds here.
bypass-textures:
- minecraft:block/farmland
- "@font_images"
- "@legacy_unicode"
bypass-models: []
bypass-sounds: []
bypass-equipments: []

View File

@@ -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());

View File

@@ -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

View File

@@ -40,7 +40,7 @@ geantyref_version=1.3.16
zstd_version=1.5.6-9
commons_io_version=2.17.0
sparrow_nbt_version=0.3
sparrow_util_version=0.18
sparrow_util_version=0.20
fastutil_version=8.5.15
netty_version=4.1.119.Final
joml_version=1.10.8