Enum Class O2PotionType
- All Implemented Interfaces:
Serializable,Comparable<O2PotionType>,Constable
Each potion type defines a distinct magical brew with its display name, implementation class, and magic difficulty level. Potions are brewed by players using cauldrons and specific ingredients, then consumed for various magical effects.
Magic levels range from BEGINNER (simple potions like Cure for Boils) to NEWT (advanced potions like Draught of Living Death).
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescription@NotNull Class<?> Get the implementation class for this potion type.@NotNull MagicLevelgetLevel()Get the magic level of this potion@NotNull StringGet the display name for this potion type.static @Nullable O2PotionTypegetPotionTypeByName(@NotNull String name) Get a potion type by its display name.static @Nullable O2PotionTypegetPotionTypeFromString(@NotNull String potionString) Get an O2PotionType enum from its enum name string.static O2PotionTypeReturns the enum constant of this class with the specified name.static O2PotionType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ANIMAGUS_POTION
-
BABBLING_BEVERAGE
-
BARUFFIOS_BRAIN_ELIXIR
-
COMMON_ANTIDOTE_POTION
-
CURE_FOR_BOILS
-
DRAUGHT_OF_LIVING_DEATH
-
FORGETFULNESS_POTION
-
HERBICIDE_POTION
-
HUNGER_POTION
-
ICE_POTION
-
MEMORY_POTION
-
OCULUS_FELIS
-
REGENERATION_POTION
-
SATIATION_POTION
-
SHRINKING_SOLUTION
-
SLEEPING_DRAUGHT
-
STRENGTHENING_SOLUTION
-
SWELLING_SOLUTION
-
WEAKNESS_POTION
-
WIDEYE_POTION
-
WIGGENWELD_POTION
-
WIT_SHARPENING_POTION
-
WOLFSBANE_POTION
-
-
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
-
getClassName
Get the implementation class for this potion type.- Returns:
- the Class object for this potion's implementation (extends O2Potion)
-
getLevel
Get the magic level of this potion- Returns:
- the magic level
-
getPotionName
Get the display name for this potion type.- Returns:
- the human-readable potion name (e.g., "Baruffio's Brain Elixir")
-
getPotionTypeFromString
@Nullable public static @Nullable O2PotionType getPotionTypeFromString(@NotNull @NotNull String potionString) Get an O2PotionType enum from its enum name string.This should be used as the opposite of toString() on the enum. This is distinctly different from
getPotionTypeByName(String)which gets the potion type by the display name, which may not match enum.toString() (e.g., "Baruffio's Brain Elixir" vs "BARUFFIOS_BRAIN_ELIXIR").- Parameters:
potionString- the enum name of the potion type (e.g., "SLEEPING_DRAUGHT", "WIGGENWELD_POTION")- Returns:
- the potion type if found, null if the string doesn't match any potion type
-
getPotionTypeByName
Get a potion type by its display name.This is distinctly different from
getPotionTypeFromString(String)which gets the potion based on the enum.toString() value. Display names may include punctuation and spaces that aren't valid in enum names (e.g., "Baruffio's Brain Elixir", "Wit-Sharpening Potion").The comparison is case-insensitive.
- Parameters:
name- the display name of the potion to find (e.g., "Sleeping Draught")- Returns:
- the potion type if found, null if no potion matches the given name
-