Interface EnchantCostCalculator
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A functional interface strategy for abstracting the logic that determines the experience level
and Lapis Lazuli cost for executing a specific enchantment.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EnchantCostCalculatorThe standard implementation for vanilla-like cost mapping, basing the cost on the enchantment's rarity weight and natural max level. -
Method Summary
Modifier and TypeMethodDescriptionintcalculateCost(net.minecraft.world.item.enchantment.Enchantment enchantment) Calculates the raw integer cost to apply the given enchantment.
-
Field Details
-
DEFAULT
The standard implementation for vanilla-like cost mapping, basing the cost on the enchantment's rarity weight and natural max level.
-
-
Method Details
-
calculateCost
int calculateCost(net.minecraft.world.item.enchantment.Enchantment enchantment) Calculates the raw integer cost to apply the given enchantment.- Parameters:
enchantment- The enchantment being evaluated.- Returns:
- The integer cost.
-