Enum Class O2HouseType
- All Implemented Interfaces:
Serializable,Comparable<O2HouseType>,Constable
O2HouseType defines the four houses of Hogwarts: Gryffindor, Hufflepuff, Ravenclaw, and Slytherin. Each house has a customizable display name, an associated chat color for player identification, and a points score that tracks performance in the house cup. Houses are customizable via configuration, allowing servers to use alternative names and colors while maintaining the house system structure.
House Properties:
- Display name: customizable via configuration (default: traditional house names)
- Chat color: customizable via O2Color enum, used for team display names
- Score: points accumulated for house cup standings, clamped to non-negative values
- 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 ConstantDescriptionGryffindor - The house of the brave, associated with red and gold.Hufflepuff - The house of the loyal and hardworking, associated with yellow and black.Ravenclaw - The house of the wise and intelligent, associated with blue and bronze.Slytherin - The house of the ambitious and cunning, associated with green and silver. -
Method Summary
Modifier and TypeMethodDescription@NotNull org.bukkit.ChatColorGet the chat color for this house@NotNull StringGet the string prefix for this house colorstatic StringgetHousePlaceText(@NotNull O2HouseType houseType) Get text for displaying the ranking of a specific house in the house cup.@NotNull StringgetName()Get the display name for this house.intgetScore()Get the current score for this house.static O2HouseTypeReturns the enum constant of this class with the specified name.static O2HouseType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
GRYFFINDOR
Gryffindor - The house of the brave, associated with red and gold. Default color: Dark Red -
HUFFLEPUFF
Hufflepuff - The house of the loyal and hardworking, associated with yellow and black. Default color: Gold -
RAVENCLAW
Ravenclaw - The house of the wise and intelligent, associated with blue and bronze. Default color: Blue -
SLYTHERIN
Slytherin - The house of the ambitious and cunning, associated with green and silver. Default color: Dark Green
-
-
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
-
getName
Get the display name for this house.Returns the name of this house. This name is customizable via server configuration and may differ from the default house name (e.g., a server might rename "Gryffindor" to a custom name).
- Returns:
- the customizable display name of this house
-
getChatColorCode
@NotNull public @NotNull org.bukkit.ChatColor getChatColorCode()Get the chat color for this house- Returns:
- the ChatColor for this house
-
getColorPrefix
Get the string prefix for this house color- Returns:
- the string prefix that sets this color
-
getScore
public int getScore()Get the current score for this house.- Returns:
- the score for this house
-
getHousePlaceText
Get text for displaying the ranking of a specific house in the house cup.Calculates the current ranking of this house compared to all other houses based on their scores. Returns text such as "in 1st place", "tied for 2nd place", or "in 4th place". Ties are detected by comparing scores with other houses; the ranking is determined by counting how many other houses have a higher score than this house. Ordinal suffixes (1st, 2nd, 3rd, 4th) are applied appropriately.
- Parameters:
houseType- the house to calculate ranking for- Returns:
- a human-readable string describing this house's ranking in the house cup, formatted as either "in Nth place" or "tied for Nth place"
-