Axis
Link to axis
导入类
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.Axis;
已实现的接口
Link to 已实现的接口
Axis implements the following interfaces. That means all methods defined in these interfaces are also available in Axis
- StringRepresentable
- Predicate<Direction>
Enum Constants
Link to enum-constants
Axis is an enum. It has 3 enum constants. They are accessible using the code below.
ZenScript Copy<constant:minecraft:direction/axis:x>
<constant:minecraft:direction/axis:y>
<constant:minecraft:direction/axis:z>
使用方式
Link to 使用方式
Name: choose
Return Type: double
ZenScript CopyAxis.choose(x as double, y as double, z as double) as double
参数 | 类型 |
---|---|
参数 x | 类型 double |
参数 y | 类型 double |
参数 z | 类型 double |
Name: choose
Return Type: int
ZenScript CopyAxis.choose(x as int, y as int, z as int) as int
参数 | 类型 |
---|---|
参数 x | 类型 int |
参数 y | 类型 int |
参数 z | 类型 int |
Name: getName
Return Type: string
ZenScript Copy// Axis.getName() as string
myAxis.getName();
Name: isHorizontal
Return Type: boolean
ZenScript Copy// Axis.isHorizontal() as boolean
myAxis.isHorizontal();
Name: isVertical
Return Type: boolean
ZenScript Copy// Axis.isVertical() as boolean
myAxis.isVertical();
Name: test
Return Type: boolean
ZenScript CopyAxis.test(direction as Direction?) as boolean
参数 | 类型 |
---|---|
参数 direction | 类型 Direction? |
名称 | 类型 | 可获得 | 可设置 |
---|---|---|---|
名称 horizontal | 类型 布尔值 | 可获得 true | 可设置 false |
名称 name(名称) | 类型 string | 可获得 true | 可设置 false |
名称 plane | 类型 Plane | 可获得 true | 可设置 false |
名称 vertical | 类型 布尔值 | 可获得 true | 可设置 false |