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 NumberProviderprivate final Holder<Enchantment> private final intstatic final MapCodec<EnchantedCountIncreaseFunction> static final intFields inherited from class LootItemConditionalFunction
predicates -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateEnchantedCountIncreaseFunction(List<LootItemCondition> predicates, Holder<Enchantment> enchantment, NumberProvider count, int limit) -
Method Summary
Modifier and TypeMethodDescriptioncodec()Set<ContextKey<?>> private booleanhasLimit()lootingMultiplier(HolderLookup.Provider registries, NumberProvider 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(List<LootItemCondition> predicates, Holder<Enchantment> enchantment, NumberProvider 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(HolderLookup.Provider registries, NumberProvider count)
-