Direction
Link to direction
导入类
Link to 导入类
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
ZenScript Copyimport crafttweaker.api.util.Direction;
已实现的接口
Link to 已实现的接口
Direction implements the following interfaces. That means all methods defined in these interfaces are also available in Direction
Enum Constants
Link to enum-constants
Direction is an enum. It has 6 enum constants. They are accessible using the code below.
ZenScript Copy<constant:minecraft:direction:down>
<constant:minecraft:direction:up>
<constant:minecraft:direction:north>
<constant:minecraft:direction:south>
<constant:minecraft:direction:west>
<constant:minecraft:direction:east>
使用方式
Link to 使用方式
Name: getAxisDirection
Return Type: AxisDirection
ZenScript Copy// Direction.getAxisDirection() as AxisDirection
myDirection.getAxisDirection();
Name: getClockWise
Return Type: Direction
ZenScript Copy// Direction.getClockWise() as Direction
myDirection.getClockWise();
Name: getCounterClockWise
Return Type: Direction
ZenScript Copy// Direction.getCounterClockWise() as Direction
myDirection.getCounterClockWise();
Name: getName
Return Type: string
ZenScript Copy// Direction.getName() as string
myDirection.getName();
Name: getNormal
Return Type: Vec3i
ZenScript Copy// Direction.getNormal() as Vec3i
myDirection.getNormal();
Name: getOpposite
Return Type: Direction
ZenScript Copy// Direction.getOpposite() as Direction
myDirection.getOpposite();
Name: getRotation
Return Type: Quaternion
ZenScript Copy// Direction.getRotation() as Quaternion
myDirection.getRotation();
Name: getStepX
Return Type: int
ZenScript Copy// Direction.getStepX() as int
myDirection.getStepX();
Name: getStepY
Return Type: int
ZenScript Copy// Direction.getStepY() as int
myDirection.getStepY();
Name: getStepZ
Return Type: int
ZenScript Copy// Direction.getStepZ() as int
myDirection.getStepZ();
Name: isFacingAngle
Return Type: boolean
ZenScript CopyDirection.isFacingAngle(degrees as float) as boolean
参数 | 类型 |
---|---|
参数 degrees | 类型 float |
Name: toYRot
Return Type: float
ZenScript Copy// Direction.toYRot() as float
myDirection.toYRot();
名称 | 类型 | 可获得 | 可设置 |
---|---|---|---|
名称 axis | 类型 Axis | 可获得 true | 可设置 false |
名称 axisDirection | 类型 AxisDirection | 可获得 true | 可设置 false |
名称 clockWise | 类型 Direction | 可获得 true | 可设置 false |
名称 counterClockWise | 类型 Direction | 可获得 true | 可设置 false |
名称 normal | 类型 Vec3i | 可获得 true | 可设置 false |
名称 opposite | 类型 Direction | 可获得 true | 可设置 false |
名称 rotation | 类型 Quaternion | 可获得 true | 可设置 false |
名称 step | 类型 Vector3f | 可获得 true | 可设置 false |
名称 stepX | 类型 int | 可获得 true | 可设置 false |
名称 stepY | 类型 int | 可获得 true | 可设置 false |
名称 stepZ | 类型 int | 可获得 true | 可设置 false |
名称 toYRot | 类型 float | 可获得 true | 可设置 false |