Package net.minecraft.util.math
Enum Direction.Axis
- All Implemented Interfaces:
Serializable
,Comparable<Direction.Axis>
,java.lang.constant.Constable
,Predicate<Direction>
,StringIdentifiable
- Enclosing class:
- Direction
public static enum Direction.Axis extends Enum<Direction.Axis> implements StringIdentifiable, Predicate<Direction>
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Field Summary
Fields Modifier and Type Field Description private static Map<String,Direction.Axis>
BY_NAME
static com.mojang.serialization.Codec<Direction.Axis>
CODEC
private String
name
private static Direction.Axis[]
VALUES
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description String
asString()
abstract double
choose(double x, double y, double z)
abstract int
choose(int x, int y, int z)
static Direction.Axis
fromName(String name)
String
getName()
Direction.Type
getType()
boolean
isHorizontal()
boolean
isVertical()
static Direction.Axis
pickRandomAxis(Random random)
boolean
test(Direction direction)
String
toString()
static Direction.Axis
valueOf(String name)
Returns the enum constant of this type with the specified name.static Direction.Axis[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
X
-
Y
-
Z
-
-
Field Details
-
VALUES
-
CODEC
-
BY_NAME
-
name
-
-
Constructor Details
-
Axis
-
-
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
-
fromName
-
getName
-
isVertical
public boolean isVertical() -
isHorizontal
public boolean isHorizontal() -
toString
- Overrides:
toString
in classEnum<Direction.Axis>
-
pickRandomAxis
-
test
-
getType
-
asString
- Specified by:
asString
in interfaceStringIdentifiable
-
choose
public abstract int choose(int x, int y, int z) -
choose
public abstract double choose(double x, double y, double z)
-