Interface EnchantmentRegistryEntry.EnchantmentCost

Enclosing interface:
EnchantmentRegistryEntry

public static interface EnchantmentRegistryEntry.EnchantmentCost
The enchantment cost interface represents the cost of applying an enchantment, split up into its different components.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the additional cost added per level of the enchantment to be applied.
    int
    Returns the base cost of this enchantment cost, no matter what level the enchantment has.
    of(int baseCost, int additionalPerLevelCost)
    Creates a new enchantment cost instance based on the passed values.
  • Method Details

    • baseCost

      int baseCost()
      Returns the base cost of this enchantment cost, no matter what level the enchantment has.
      Returns:
      the cost in levels.
    • additionalPerLevelCost

      int additionalPerLevelCost()
      Returns the additional cost added per level of the enchantment to be applied. This cost is applied per level above the first.
      Returns:
      the cost added to the baseCost() for each level above the first.
    • of

      @Contract(value="_,_ -> new", pure=true) static EnchantmentRegistryEntry.EnchantmentCost of(int baseCost, int additionalPerLevelCost)
      Creates a new enchantment cost instance based on the passed values.
      Parameters:
      baseCost - the base cost of the enchantment cost as returned by baseCost()
      additionalPerLevelCost - the additional cost per level, as returned by additionalPerLevelCost()
      Returns:
      the created instance.