Enum Class Position

java.lang.Object
java.lang.Enum<Position>
net.uku3lig.ukulib.utils.Position
All Implemented Interfaces:
Serializable, Comparable<Position>, Constable, net.minecraft.util.TranslatableOption

public enum Position extends Enum<Position> implements net.minecraft.util.TranslatableOption
An enum used to represent various positions. The actual position is implementation specific.
  • Enum Constant Details

    • TOP_LEFT

      public static final Position TOP_LEFT
      The top left of the screen.
    • TOP_RIGHT

      public static final Position TOP_RIGHT
      The top right of the screen.
    • BOTTOM_LEFT

      public static final Position BOTTOM_LEFT
      The bottom left of the screen.
    • BOTTOM_RIGHT

      public static final Position BOTTOM_RIGHT
      The bottom right of the screen.
    • MIDDLE

      public static final Position MIDDLE
      Above the experience bar, usually between the health and hunger bars.
  • Field Details

  • Method Details

    • values

      public static Position[] 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 Position 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
    • isRight

      public boolean isRight()
      Checks if the position is on the right of the screen.
      Returns:
      true if the position is on the right of the screen
    • isBottom

      public boolean isBottom()
      Checks if the position is at the bottom of the screen.
      Returns:
      true if the position is at the bottom of the screen
    • getOption

      public static CyclingOption<Position> getOption(Position initialValue, Consumer<Position> setter)
      Creates a CyclingOption that allows to choose between all of this enum's values.
      Parameters:
      initialValue - The initial
      setter - The action to be performed when the value changes
      Returns:
      The generated option
      See Also:
    • getOption

      public static CyclingOption<Position> getOption(Collection<Position> allowedValues, Position initialValue, Consumer<Position> setter)
      Creates a CyclingOption that allows to choose between all the allowedValues.
      Parameters:
      allowedValues - The values the option will cycle through
      initialValue - The initial value
      setter - The action to be performed when the value changes
      Returns:
      The generated option
      See Also:
    • getId

      public int getId()
      Specified by:
      getId in interface net.minecraft.util.TranslatableOption
    • getTranslationKey

      public String getTranslationKey()
      Specified by:
      getTranslationKey in interface net.minecraft.util.TranslatableOption