public enum Direction extends Enum<Direction>
| Modifier and Type | Class and Description |
|---|---|
static class |
Direction.Axis |
static class |
Direction.AxisDirection |
static class |
Direction.Plane |
| Modifier and Type | Method and Description |
|---|---|
static Direction |
fromAxis(Direction.AxisDirection axisDirection,
Direction.Axis axis) |
static Direction |
fromHorizontalAngle(double angle)
Get the BlockFace corresponding to the given angle (0-360).
|
static Direction |
fromHorizontalIndex(int index)
Get a BlockFace by it's horizontal index (0-3).
|
static Direction |
fromIndex(int index)
Get a BlockFace by it's index (0-5).
|
Direction.Axis |
getAxis()
Get the Axis of this BlockFace
|
Direction.AxisDirection |
getAxisDirection()
Get the AxisDirection of this BlockFace
|
CardinalDirection |
getCardinalDirection() |
float |
getHorizontalAngle()
Get the angle of this BlockFace (0-360)
|
int |
getHorizontalIndex()
Get the horizontal index of this BlockFace (0-3).
|
int |
getIndex()
Get the index of this BlockFace (0-5).
|
String |
getName()
Get the name of this BlockFace (up, down, north, etc.)
|
com.nukkitx.math.vector.Vector3i |
getOffset(com.nukkitx.math.vector.Vector3i pos) |
com.nukkitx.math.vector.Vector3i |
getOffset(com.nukkitx.math.vector.Vector3i pos,
int step) |
Direction |
getOpposite()
Get the opposite BlockFace (e.g.
|
com.nukkitx.math.vector.Vector3i |
getUnitVector()
Get the unit vector of this BlockFace
|
int |
getXOffset()
Returns an offset that addresses the block in front of this BlockFace
|
int |
getYOffset()
Returns an offset that addresses the block in front of this BlockFace
|
int |
getZOffset()
Returns an offset that addresses the block in front of this BlockFace
|
static Direction |
random(Random rand)
Choose a random BlockFace using the given Random
|
Direction |
rotateY()
Rotate this BlockFace around the Y axis clockwise (NORTH => EAST => SOUTH => WEST => BB_NORTH)
|
Direction |
rotateYCCW()
Rotate this BlockFace around the Y axis counter-clockwise (NORTH => WEST => SOUTH => EAST => BB_NORTH)
|
String |
toString() |
static Direction |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Direction[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Direction DOWN
public static final Direction UP
public static final Direction NORTH
public static final Direction SOUTH
public static final Direction WEST
public static final Direction EAST
public static Direction[] values()
for (Direction c : Direction.values()) System.out.println(c);
public static Direction valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static Direction fromIndex(int index)
index - BlockFace indexpublic static Direction fromHorizontalIndex(int index)
index - BlockFace indexpublic static Direction fromHorizontalAngle(double angle)
angle - horizontal anglepublic static Direction fromAxis(Direction.AxisDirection axisDirection, Direction.Axis axis)
public static Direction random(Random rand)
rand - random number generatorpublic int getIndex()
public int getHorizontalIndex()
public CardinalDirection getCardinalDirection()
public float getHorizontalAngle()
public String getName()
public Direction.Axis getAxis()
public Direction.AxisDirection getAxisDirection()
public com.nukkitx.math.vector.Vector3i getUnitVector()
public com.nukkitx.math.vector.Vector3i getOffset(com.nukkitx.math.vector.Vector3i pos)
public com.nukkitx.math.vector.Vector3i getOffset(com.nukkitx.math.vector.Vector3i pos,
int step)
public int getXOffset()
public int getYOffset()
public int getZOffset()
public Direction getOpposite()
public Direction rotateY()
public Direction rotateYCCW()
Copyright © 2020. All rights reserved.