mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-20 15:39:22 +00:00
fix uniform number
This commit is contained in:
@@ -44,6 +44,8 @@ resource-pack:
|
|||||||
# Please add the ignored textures/models/sounds here.
|
# Please add the ignored textures/models/sounds here.
|
||||||
bypass-textures:
|
bypass-textures:
|
||||||
- minecraft:block/farmland
|
- minecraft:block/farmland
|
||||||
|
- "@font_images"
|
||||||
|
- "@legacy_unicode"
|
||||||
bypass-models: []
|
bypass-models: []
|
||||||
bypass-sounds: []
|
bypass-sounds: []
|
||||||
bypass-equipments: []
|
bypass-equipments: []
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public class SetCountFunction<T> extends AbstractLootConditionalFunction<T> {
|
|||||||
@Override
|
@Override
|
||||||
public LootFunction<A> create(Map<String, Object> arguments) {
|
public LootFunction<A> create(Map<String, Object> arguments) {
|
||||||
Object value = arguments.get("count");
|
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"))
|
List<LootCondition> conditions = Optional.ofNullable(arguments.get("conditions"))
|
||||||
.map(it -> LootConditions.fromMapList((List<Map<String, Object>>) it))
|
.map(it -> LootConditions.fromMapList((List<Map<String, Object>>) it))
|
||||||
.orElse(Collections.emptyList());
|
.orElse(Collections.emptyList());
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public class UniformNumberProvider implements NumberProvider {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getInt(LootContext context) {
|
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
|
@Override
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ geantyref_version=1.3.16
|
|||||||
zstd_version=1.5.6-9
|
zstd_version=1.5.6-9
|
||||||
commons_io_version=2.17.0
|
commons_io_version=2.17.0
|
||||||
sparrow_nbt_version=0.3
|
sparrow_nbt_version=0.3
|
||||||
sparrow_util_version=0.18
|
sparrow_util_version=0.20
|
||||||
fastutil_version=8.5.15
|
fastutil_version=8.5.15
|
||||||
netty_version=4.1.119.Final
|
netty_version=4.1.119.Final
|
||||||
joml_version=1.10.8
|
joml_version=1.10.8
|
||||||
|
|||||||
Reference in New Issue
Block a user