BlockPos
Link to blockpos
导入类
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.math.BlockPos;
Extending Vec3i
Link to extending-vec3i
BlockPos extends Vec3i. That means all methods available in Vec3i are also available in BlockPos
Constructor #构造函数
Link to constructor-构造函数
Creates a new BlockPos using the values of the given vector. Note, the values will be floored down, providing 0.85 is the same as providing 0.
ZenScript Copynew BlockPos(vector as Vec3) as BlockPos
new BlockPos(new Vec3(0, 1, 2));
参数 | 类型 | 描述 |
---|---|---|
参数 vector | 类型 Vec3 | 描述 The vector to copy the values of. |
Creates a new BlockPos using the provided values.
ZenScript Copynew BlockPos(x as int, y as int, z as int) as BlockPos
new BlockPos(0, 1, 2);
参数 | 类型 | 描述 |
---|---|---|
参数 x | 类型 int | 描述 The x value of the blockpos |
参数 y | 类型 int | 描述 The y value of the blockpos |
参数 z | 类型 int | 描述 The z value of the blockpos |
使用方式
Link to 使用方式
Name: above
Return Type: BlockPos
ZenScript CopyBlockPos.above(distance as int) as BlockPos
参数 | 类型 |
---|---|
参数 distance | 类型 int |
Name: asImmutable
Return Type: BlockPos
ZenScript Copy// BlockPos.asImmutable() as BlockPos
myBlockPos.asImmutable();
Name: asLong
Return Type: long
ZenScript Copy// BlockPos.asLong() as long
myBlockPos.asLong();
Name: asMutable
Return Type: MutableBlockPos
ZenScript Copy// BlockPos.asMutable() as MutableBlockPos
myBlockPos.asMutable();
Name: atY
Return Type: BlockPos
ZenScript CopyBlockPos.atY(value as int) as BlockPos
参数 | 类型 |
---|---|
参数 value | 类型 int |
Name: below
Return Type: BlockPos
ZenScript CopyBlockPos.below(distance as int) as BlockPos
参数 | 类型 |
---|---|
参数 distance | 类型 int |
Name: east
Return Type: BlockPos
ZenScript CopyBlockPos.east(distance as int) as BlockPos
参数 | 类型 |
---|---|
参数 distance | 类型 int |
Name: multiply
Return Type: BlockPos
ZenScript CopyBlockPos.multiply(scalar as int) as BlockPos
参数 | 类型 |
---|---|
参数 scalar | 类型 int |
Name: north
Return Type: BlockPos
ZenScript CopyBlockPos.north(distance as int) as BlockPos
参数 | 类型 |
---|---|
参数 distance | 类型 int |
Name: offset
Return Type: BlockPos
ZenScript CopyBlockPos.offset(x as double, y as double, z as double) as BlockPos
参数 | 类型 |
---|---|
参数 x | 类型 double |
参数 y | 类型 double |
参数 z | 类型 double |
Name: offset
Return Type: BlockPos
ZenScript CopyBlockPos.offset(x as int, y as int, z as int) as BlockPos
参数 | 类型 |
---|---|
参数 x | 类型 int |
参数 y | 类型 int |
参数 z | 类型 int |
Name: south
Return Type: BlockPos
ZenScript CopyBlockPos.south(distance as int) as BlockPos
参数 | 类型 |
---|---|
参数 distance | 类型 int |
Name: west
Return Type: BlockPos
ZenScript CopyBlockPos.west(distance as int) as BlockPos
参数 | 类型 |
---|---|
参数 distance | 类型 int |