Enum Class PowerBonusType
java.lang.Object
java.lang.Enum<PowerBonusType>
johnsmith.enchantingoverhauled.api.enchantment.theme.power.bonus.PowerBonusType
- All Implemented Interfaces:
Serializable,Comparable<PowerBonusType>,Constable
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionIdentifies the bonus that adds power based on a matching block state property string value.Identifies the bonus that adds power based on counting specific items within a block entity's inventory.Identifies the bonus that multiplies the base power by the integer value of a block state property. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<? extends PowerBonus> getCodec()Retrieves the map codec associated with this bonus type.static com.mojang.serialization.MapCodec<? extends PowerBonus> getCodecById(String id) Static helper method used by thePowerBonus.CODECdispatch logic.getId()Retrieves the unique string identifier for this bonus type.static PowerBonusTypeReturns the enum constant of this class with the specified name.static PowerBonusType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ADD_IF_BLOCK_STATE
Identifies the bonus that adds power based on a matching block state property string value. -
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
Identifies the bonus that multiplies the base power by the integer value of a block state property.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
getId
Retrieves the unique string identifier for this bonus type.- Returns:
- The unique ID string.
-
getCodec
Retrieves the map codec associated with this bonus type.- Returns:
- The
MapCodecfor the correspondingPowerBonusimplementation.
-
getCodecById
Static helper method used by thePowerBonus.CODECdispatch logic.Maps a raw string identifier (read from the
"type"field in a JSON data file) to the appropriateMapCodecfor deserialization.- Parameters:
id- The string identifier of the bonus type.- Returns:
- The corresponding
MapCodecfor that ID. - Throws:
IllegalArgumentException- If the provided ID does not match any registered bonus type.
-