Package net.uku3lig.ukulib.utils
Enum Class Position
- All Implemented Interfaces:
Serializable,Comparable<Position>,Constable,net.minecraft.util.StringRepresentable,StringTranslatable
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>>Nested classes/interfaces inherited from interface net.minecraft.util.StringRepresentable
net.minecraft.util.StringRepresentable.EnumCodec<E extends Enum<E> & net.minecraft.util.StringRepresentable>, net.minecraft.util.StringRepresentable.StringRepresentableCodec<S extends net.minecraft.util.StringRepresentable> -
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. -
Field Summary
FieldsFields inherited from interface net.minecraft.util.StringRepresentable
PRE_BUILT_MAP_THRESHOLD -
Method Summary
Modifier and TypeMethodDescriptiongetName()Name of the option, also used as its unique identifier forStringRepresentable.static CyclingOption<Position> Creates aCyclingOptionthat allows to choose between all theallowedValues.static CyclingOption<Position> Creates aCyclingOptionthat allows to choose between all of this enum's values.The translation key of the optionbooleanisBottom()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.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfMethods inherited from interface net.uku3lig.ukulib.config.option.StringTranslatable
getSerializedName, getText
-
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.
-
-
Field Details
-
KEY
Translation key for the position- See Also:
-
-
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
Creates aCyclingOptionthat allows to choose between all of this enum's values.- Parameters:
initialValue- The initialsetter- 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 aCyclingOptionthat allows to choose between all theallowedValues.- Parameters:
allowedValues- The values the option will cycle throughinitialValue- The initial valuesetter- The action to be performed when the value changes- Returns:
- The generated option
- See Also:
-
getName
Description copied from interface:StringTranslatableName of the option, also used as its unique identifier forStringRepresentable.- Specified by:
getNamein interfaceStringTranslatable- Returns:
- The name of the option
- See Also:
-
getTranslationKey
Description copied from interface:StringTranslatableThe translation key of the option- Specified by:
getTranslationKeyin interfaceStringTranslatable- Returns:
- The translation key
-