Enum Class DirectionCorner
- All Implemented Interfaces:
Serializable
,Comparable<DirectionCorner>
,Constable
An equivalent to
Direction
for being able to also refer to
block positions that are at a euclidian distance of maximum 2.- See Also:
-
Direction
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescription+X;-Y-Z;-Y+Z;-Y-X;-Y+Z;+Y-Z;+Y-X;+Y+X;+YUsed only by getOrientation, for invalid inputs+X;+Y-Z;+Y+Z;+Y-X;+Y -
Field Summary
Modifier and TypeFieldDescriptionfinal int
The bitwise identifier for this direction, used for bitwise toggling of directions.final int
The offset in the X axis.final int
The offset in the Y axis.final int
The offset in the Z axis.static final DirectionCorner[]
All the valid directions. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.core.BlockPos
fromOffset
(net.minecraft.core.BlockPos pos) Offset from the given position with the current corner.static DirectionCorner
getOrientation
(int id) Get the direction of the given value, inverse of the @see DirectionCorner#ordinal() method.static DirectionCorner
Returns the enum constant of this class with the specified name.static DirectionCorner[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
UPPER_NORTH
-Z;+Y -
UPPER_SOUTH
+Z;+Y -
UPPER_WEST
-X;+Y -
UPPER_EAST
+X;+Y -
MIDDLE_NORTHWEST
-Z;+Y -
MIDDLE_NORTHEAST
+Z;+Y -
MIDDLE_SOUTHEAST
-X;+Y -
MIDDLE_SOUTHWEST
+X;+Y -
LOWER_NORTH
-Z;-Y -
LOWER_SOUTH
+Z;-Y -
LOWER_WEST
-X;-Y -
LOWER_EAST
+X;-Y -
UNKNOWN
Used only by getOrientation, for invalid inputs
-
-
Field Details
-
offsetX
public final int offsetXThe offset in the X axis. -
offsetY
public final int offsetYThe offset in the Y axis. -
offsetZ
public final int offsetZThe offset in the Z axis. -
flag
public final int flagThe bitwise identifier for this direction, used for bitwise toggling of directions. -
VALID_DIRECTIONS
All the valid directions.
-
-
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
-
getOrientation
Get the direction of the given value, inverse of the @see DirectionCorner#ordinal() method.- Parameters:
id
- The ordinal value of a direction.- Returns:
- The direction for the given ordinal value.
-
fromOffset
public net.minecraft.core.BlockPos fromOffset(net.minecraft.core.BlockPos pos) Offset from the given position with the current corner.- Parameters:
pos
- The position.- Returns:
- The offsetted position.
-