java.lang.Object
java.lang.Enum<PowerBonusType>
johnsmith.enchantingoverhauled.api.enchantment.theme.power.bonus.PowerBonusType
All Implemented Interfaces:
Serializable, Comparable<PowerBonusType>, Constable

public enum PowerBonusType extends Enum<PowerBonusType>
An enumeration representing the different types of conditional power bonuses available in the enchantment theme system.

Serves as the key registry in the PowerBonus.CODEC dispatch mechanism, mapping the string ID found in JSON data files to the corresponding MapCodec responsible for deserializing that specific bonus implementation.

  • Enum Constant Details

    • ADD_IF_BLOCK_STATE

      public static final PowerBonusType ADD_IF_BLOCK_STATE
      Identifies the bonus that adds power based on a matching block state property string value.
    • COUNT_ITEMS_IN_INVENTORY

      public static final PowerBonusType COUNT_ITEMS_IN_INVENTORY
      Identifies the bonus that adds power based on counting specific items within a block entity's inventory.
    • MULTIPLY_BY_BLOCK_STATE

      public static final PowerBonusType MULTIPLY_BY_BLOCK_STATE
      Identifies the bonus that multiplies the base power by the integer value of a block state property.
  • Method Details

    • values

      public static PowerBonusType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PowerBonusType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getId

      public String getId()
      Retrieves the unique string identifier for this bonus type.
      Returns:
      The unique ID string.
    • getCodec

      public com.mojang.serialization.MapCodec<? extends PowerBonus> getCodec()
      Retrieves the map codec associated with this bonus type.
      Returns:
      The MapCodec for the corresponding PowerBonus implementation.
    • getCodecById

      public static com.mojang.serialization.MapCodec<? extends PowerBonus> getCodecById(String id)
      Static helper method used by the PowerBonus.CODEC dispatch logic.

      Maps a raw string identifier (read from the "type" field in a JSON data file) to the appropriate MapCodec for deserialization.

      Parameters:
      id - The string identifier of the bonus type.
      Returns:
      The corresponding MapCodec for that ID.
      Throws:
      IllegalArgumentException - If the provided ID does not match any registered bonus type.