Enum Class O2HouseType

java.lang.Object
java.lang.Enum<O2HouseType>
net.pottercraft.ollivanders2.house.O2HouseType
All Implemented Interfaces:
Serializable, Comparable<O2HouseType>, Constable

public enum O2HouseType extends Enum<O2HouseType>
Enumeration of Hogwarts houses with customizable names, colors, and points tracking.

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:
  • Enum Constant Details

    • GRYFFINDOR

      public static final O2HouseType GRYFFINDOR
      Gryffindor - The house of the brave, associated with red and gold. Default color: Dark Red
    • HUFFLEPUFF

      public static final O2HouseType HUFFLEPUFF
      Hufflepuff - The house of the loyal and hardworking, associated with yellow and black. Default color: Gold
    • RAVENCLAW

      public static final O2HouseType RAVENCLAW
      Ravenclaw - The house of the wise and intelligent, associated with blue and bronze. Default color: Blue
    • SLYTHERIN

      public static final O2HouseType SLYTHERIN
      Slytherin - The house of the ambitious and cunning, associated with green and silver. Default color: Dark Green
  • Method Details

    • values

      public static O2HouseType[] 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 O2HouseType 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
    • getName

      @NotNull public @NotNull String 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

      @NotNull public @NotNull String 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

      public static String getHousePlaceText(@NotNull @NotNull O2HouseType houseType)
      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"