Enum Class O2StationarySpellType
- All Implemented Interfaces:
Serializable,Comparable<O2StationarySpellType>,Constable
Each stationary spell type encapsulates the implementation class and magic level required to cast the spell. Stationary spells are area-of-effect spells that persist in a location and affect players within their radius.
This enum provides utility methods for looking up spells by name, checking if a player is within a spell's radius, and retrieving spell metadata such as class and magic level.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAliquam Floo: A Floo Network destination spell for stationary networks.Cave Inimicum: A protective barrier spell that repels enemies.Colloportus: Seals a passage magically.Harmonia Nectere Passus: A spell that creates harmony and binding effects.Herbicide: Kills plants and vegetation in an area.Horcrux: Creates or manages Horcrux objects.Lumos Fervens: Creates intense light and heat in an area.Molliare: A cushioning spell that softens impacts.Muffliato: Mutes conversations within a specified area.Nullum Apparebit: Makes objects or effects invisible or undetectable.Nullum Evanescunt: Causes objects or effects to vanish from an area.Protego Horribilis: A protection curse that defends against attacks.Protego Maxima: A maximum-strength protective barrier spell.Protego Totalum: A comprehensive protective spell covering an entire area.Repello Muggleton: Repels non-magical people from a protected area. -
Method Summary
Modifier and TypeMethodDescription@NotNull Class<?> Gets the implementation class for this stationary spell type.@NotNull MagicLevelgetLevel()Gets the magic level required to cast this stationary spell.@NotNull StringGets the human-readable name for this spell type.static @Nullable O2StationarySpellTypegetStationarySpellTypeFromString(@NotNull String name) Looks up a stationary spell type by its enum name (case-insensitive).booleanisPlayerInsideStationarySpell(@NotNull org.bukkit.entity.Player player) Checks whether a player is within the radius of an active stationary spell of this type.static O2StationarySpellTypeReturns the enum constant of this class with the specified name.static O2StationarySpellType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ALIQUAM_FLOO
Aliquam Floo: A Floo Network destination spell for stationary networks.- See Also:
-
CAVE_INIMICUM
Cave Inimicum: A protective barrier spell that repels enemies.- See Also:
-
COLLOPORTUS
Colloportus: Seals a passage magically. Requires expert level and can only be undone with Alohomora.- See Also:
-
HARMONIA_NECTERE_PASSUS
Harmonia Nectere Passus: A spell that creates harmony and binding effects.- See Also:
-
HERBICIDE
Herbicide: Kills plants and vegetation in an area.- See Also:
-
HORCRUX
Horcrux: Creates or manages Horcrux objects.- See Also:
-
LUMOS_FERVENS
Lumos Fervens: Creates intense light and heat in an area.- See Also:
-
MOLLIARE
Molliare: A cushioning spell that softens impacts.- See Also:
-
MUFFLIATO
Muffliato: Mutes conversations within a specified area.- See Also:
-
NULLUM_APPAREBIT
Nullum Apparebit: Makes objects or effects invisible or undetectable.- See Also:
-
NULLUM_EVANESCUNT
Nullum Evanescunt: Causes objects or effects to vanish from an area.- See Also:
-
PROTEGO_HORRIBILIS
Protego Horribilis: A protection curse that defends against attacks.- See Also:
-
PROTEGO_MAXIMA
Protego Maxima: A maximum-strength protective barrier spell.- See Also:
-
PROTEGO_TOTALUM
Protego Totalum: A comprehensive protective spell covering an entire area.- See Also:
-
REPELLO_MUGGLETON
Repello Muggleton: Repels non-magical people from a protected area.- See Also:
-
-
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
Gets the implementation class for this stationary spell type.- Returns:
- the Class object representing the implementation of this spell (never null)
-
getLevel
Gets the magic level required to cast this stationary spell.The level is used to determine compatibility with counter-spells and defensive magic. A counter-spell must be of equal or higher level to successfully dispel this spell.
- Returns:
- the magic level of this spell (never null)
-
getStationarySpellTypeFromString
@Nullable public static @Nullable O2StationarySpellType getStationarySpellTypeFromString(@NotNull @NotNull String name) Looks up a stationary spell type by its enum name (case-insensitive).The method converts the input string to uppercase and attempts to match it against the enum constant names. For example, "muffliato" or "MUFFLIATO" both resolve to
MUFFLIATO. Invalid names gracefully return null without throwing an exception.- Parameters:
name- the name of the spell to look up (not null)- Returns:
- the matching spell type, or null if no spell with that name exists
-
getSpellName
Gets the human-readable name for this spell type.Transforms the enum constant name by replacing underscores with spaces and capitalizing the first letter of each word. For example,
MUFFLIATObecomes "Muffliato" andPROTEGO_MAXIMAbecomes "Protego Maxima".- Returns:
- the formatted spell name (never null)
-
isPlayerInsideStationarySpell
public boolean isPlayerInsideStationarySpell(@NotNull @NotNull org.bukkit.entity.Player player) Checks whether a player is within the radius of an active stationary spell of this type.Retrieves all active stationary spells at the player's current location and checks if any are of this spell type. A player may be affected by multiple spell types simultaneously.
- Parameters:
player- the player to check (not null)- Returns:
- true if the player is within the radius of at least one active spell of this type, false otherwise
-