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.

@FunctionalInterface public interface EnchantCostCalculator
A functional interface strategy for abstracting the logic that determines the experience level and Lapis Lazuli cost for executing a specific enchantment.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    The standard implementation for vanilla-like cost mapping, basing the cost on the enchantment's rarity weight and natural max level.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    calculateCost(net.minecraft.world.item.enchantment.Enchantment enchantment)
    Calculates the raw integer cost to apply the given enchantment.
  • Field Details

    • DEFAULT

      static final EnchantCostCalculator 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.