Enum CenterFormat

java.lang.Object
java.lang.Enum<CenterFormat>
de.marcely.bedwars.tools.gui.CenterFormat
All Implemented Interfaces:
Serializable, Comparable<CenterFormat>, java.lang.constant.Constable

public enum CenterFormat extends Enum<CenterFormat>
Helper for easily aligning items in a GUI
  • Enum Constant Details

    • CENTRALIZED

      public static final CenterFormat CENTRALIZED
      Item: X, Air: O
      Example with 3 items: O O O X X X O O O
      Example with 2 items: O O O X X O O O O
    • CENTRALIZED_EVEN

      public static final CenterFormat CENTRALIZED_EVEN
      Item: X, Air: O
      Example with 3 items: O O O X X X O O O
      Example with 2 items: O O O X O X O O O
    • ALIGNED

      public static final CenterFormat ALIGNED
      Item: X, Air: O
      Example with 3 items:
      O X O X O X O X O
  • Method Details

    • values

      public static CenterFormat[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static CenterFormat valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
      NullPointerException - if the argument is null
    • calculate

      public int calculate(int index, int amount, int min, int max)