Package net.uku3lig.ukulib.config
Enum Class Position
- All Implemented Interfaces:
Serializable,Comparable<Position>,Constable
An enum used to represent various positions.
The actual position is implementation specific.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe bottom left of the screen.The bottom right of the screen.Above the experience bar, usually between the health and hunger bars.The top left of the screen.The top right of the screen. -
Method Summary
Modifier and TypeMethodDescriptionintgetId()The id of the position.static net.minecraft.client.option.CyclingOption<Position>Creates aCyclingOptionthat allows to choose between all theallowedValues.static net.minecraft.client.option.CyclingOption<Position>Creates aCyclingOptionthat allows to choose between all of this enum's values.The translation key of the position.booleanisBottom()Checks if the position is at the bottom of the screen.booleanisRight()Checks if the position is on the right of the screen.static PositionReturns the enum constant of this class with the specified name.static Position[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
TOP_LEFT
The top left of the screen. -
TOP_RIGHT
The top right of the screen. -
BOTTOM_LEFT
The bottom left of the screen. -
BOTTOM_RIGHT
The bottom right of the screen. -
MIDDLE
Above the experience bar, usually between the health and hunger bars.
-
-
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
-
isRight
public boolean isRight()Checks if the position is on the right of the screen.- Returns:
trueif 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:
trueif the position is at the bottom of the screen
-
getOption
public static net.minecraft.client.option.CyclingOption<Position> getOption(Supplier<Position> getter, Consumer<Position> setter) Creates aCyclingOptionthat allows to choose between all of this enum's values.- Parameters:
getter- Gets the default value for the optionsetter- The action to be performed when the value changes- Returns:
- The generated option
- See Also:
-
getOption
public static net.minecraft.client.option.CyclingOption<Position> getOption(Collection<Position> allowedValues, Supplier<Position> getter, Consumer<Position> setter) Creates aCyclingOptionthat allows to choose between all theallowedValues.- Parameters:
allowedValues- The values the option will cycle throughgetter- Gets the default value for the optionsetter- The action to be performed when the value changes- Returns:
- The generated option
-
getId
public int getId()The id of the position.- Returns:
- The id
-
getTranslationKey
The translation key of the position.- Returns:
- The translation key
-