Class EnchantedCountIncreaseFunction
java.lang.Object
net.minecraft.world.level.storage.loot.functions.LootItemConditionalFunction
net.minecraft.world.level.storage.loot.functions.EnchantedCountIncreaseFunction
- All Implemented Interfaces:
BiFunction<ItemStack, LootContext, ItemStack>, LootItemFunction, LootContextUser, Validatable
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Holder<ContextFloatProvider> private final Holder<Enchantment> private final intstatic final com.mojang.serialization.MapCodec<EnchantedCountIncreaseFunction> static final intFields inherited from class LootItemConditionalFunction
condition -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateEnchantedCountIncreaseFunction(Optional<Holder<LootItemCondition>> condition, Holder<Enchantment> enchantment, Holder<ContextFloatProvider> count, int limit) -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<EnchantedCountIncreaseFunction> codec()Set<ContextKey<?>> private booleanhasLimit()lootingMultiplier(HolderGetter<Enchantment> enchantments, Holder<ContextFloatProvider> count) run(ItemStack itemStack, LootContext context) voidvalidate(ValidationContext context) Methods inherited from class LootItemConditionalFunction
apply, commonFields, simpleBuilderMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BiFunction
andThen
-
Field Details
-
NO_LIMIT
public static final int NO_LIMIT- See Also:
-
MAP_CODEC
-
enchantment
-
count
-
limit
private final int limit
-
-
Constructor Details
-
EnchantedCountIncreaseFunction
private EnchantedCountIncreaseFunction(Optional<Holder<LootItemCondition>> condition, Holder<Enchantment> enchantment, Holder<ContextFloatProvider> count, int limit)
-
-
Method Details
-
codec
- Specified by:
codecin interfaceLootItemFunction- Specified by:
codecin classLootItemConditionalFunction
-
getReferencedContextParams
-
validate
- Specified by:
validatein interfaceLootContextUser- Specified by:
validatein interfaceValidatable- Overrides:
validatein classLootItemConditionalFunction
-
hasLimit
private boolean hasLimit() -
run
- Specified by:
runin classLootItemConditionalFunction
-
lootingMultiplier
public static EnchantedCountIncreaseFunction.Builder lootingMultiplier(HolderGetter<Enchantment> enchantments, Holder<ContextFloatProvider> count)
-