Enum XYZD.Direction
- All Implemented Interfaces:
Serializable,Comparable<XYZD.Direction>,java.lang.constant.Constable
- Enclosing class:
XYZD
Represents a compass direction.
Mainly used for storing beds and their direction.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable XYZD.DirectionfromBlockFace(BlockFace face) Returns the direction from the given block facestatic @Nullable XYZD.DirectionfromLegacy(int id) Returns the direction from the given legacy idstatic @Nullable XYZD.DirectionReturns the direction from the given nameintgetModX()Returns the x coordinate modifier for this directionintgetModZ()Returns the z coordinate modifier for this directioninttoLegacy()Returns the id that has been used in the legacy versions (1.12 and older) of the gamestatic XYZD.DirectionReturns the enum constant of this type with the specified name.static XYZD.Direction[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
NORTH
-
SOUTH
-
EAST
-
WEST
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
asBlockFace
-
getModX
public int getModX()Returns the x coordinate modifier for this directionEASTreturns 1,WESTreturns -1, and all other directions return 0- Returns:
- The x coordinate modifier
-
getModZ
public int getModZ()Returns the z coordinate modifier for this directionSOUTHreturns 1,NORTHreturns -1, and all other directions return 0- Returns:
- The z coordinate modifier
-
toLegacy
public int toLegacy()Returns the id that has been used in the legacy versions (1.12 and older) of the gameThis refers to the block data that was used for beds.
- Returns:
- The legacy id
-
fromName
Returns the direction from the given nameName refers to
Enum.name(). The name is case-insensitive.- Parameters:
name- The name of the direction- Returns:
- The direction or
nullif the name is invalid
-
fromBlockFace
Returns the direction from the given block face- Parameters:
face- The block face- Returns:
- The direction or
nullif the block face is invalid
-
fromLegacy
Returns the direction from the given legacy id- Parameters:
id- The legacy id- Returns:
- The direction or
nullif the id is invalid - See Also:
-