类 BlockPos
java.lang.Object
io.github.lijinhong11.mittellib.configuration.ReadWriteObject
io.github.lijinhong11.mittellib.math.BlockPos
- 所有已实现的接口:
Comparable<BlockPos>
Represents a block position in 3D space with integer coordinates.
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明intintdistanceManhattan(BlockPos other) Calculates the Manhattan distance (sum of absolute differences) to another BlockPos.intdistanceSquared(BlockPos other) Calculates the squared distance to another BlockPos.static BlockPosfromLocation(Location location) Creates a BlockPos from a Bukkit Location.longConverts this BlockPos to a long number which represents this BlockPosReturns a BlockPos with the maximum coordinates of this and another position.Returns a BlockPos with the minimum coordinates of this and another position.minus(int x, int y, int z) Subtracts the specified offsets from this position.Subtracts another BlockPos from this position.plus(int x, int y, int z) Adds the specified offsets to this position.Adds another BlockPos to this position.voidtoLocation(World world) Converts this BlockPos to a Bukkit Location in the specified world.toMap()Converts this BlockPos to an unmodifiable map with keys "x", "y", "z".@NotNull StringtoString()voidintx()Get x coordinateinty()Get y coordinateintz()Get z coordinate从类继承的方法 io.github.lijinhong11.mittellib.configuration.ReadWriteObject
read
-
构造器详细资料
-
BlockPos
-
-
方法详细资料
-
x
public int x()Get x coordinate- 返回:
- the x coordinate
-
y
public int y()Get y coordinate- 返回:
- the y coordinate
-
z
public int z()Get z coordinate- 返回:
- the z coordinate
-
fromLocation
Creates a BlockPos from a Bukkit Location.- 参数:
location- the location to convert- 返回:
- a new BlockPos with the location's block coordinates
-
toLocation
Converts this BlockPos to a Bukkit Location in the specified world.- 参数:
world- the world for the location- 返回:
- a new Location at this block position
-
plus
Adds the specified offsets to this position.- 参数:
x- the X offsety- the Y offsetz- the Z offset- 返回:
- a new BlockPos with the added coordinates
-
plus
Adds another BlockPos to this position.- 参数:
pos- the position to add- 返回:
- a new BlockPos with the added coordinates
-
minus
Subtracts the specified offsets from this position.- 参数:
x- the X offsety- the Y offsetz- the Z offset- 返回:
- a new BlockPos with the subtracted coordinates
-
minus
Subtracts another BlockPos from this position.- 参数:
pos- the position to subtract- 返回:
- a new BlockPos with the subtracted coordinates
-
distanceSquared
Calculates the squared distance to another BlockPos.- 参数:
other- the other position- 返回:
- the squared distance
-
distanceManhattan
Calculates the Manhattan distance (sum of absolute differences) to another BlockPos.- 参数:
other- the other position- 返回:
- the Manhattan distance
-
min
Returns a BlockPos with the minimum coordinates of this and another position.- 参数:
other- the other position- 返回:
- a new BlockPos with minimum coordinates
-
max
Returns a BlockPos with the maximum coordinates of this and another position.- 参数:
other- the other position- 返回:
- a new BlockPos with maximum coordinates
-
toMap
Converts this BlockPos to an unmodifiable map with keys "x", "y", "z".- 返回:
- a map containing the coordinates
-
getBlockKey
public long getBlockKey()Converts this BlockPos to a long number which represents this BlockPos- 返回:
- a long number which represents this BlockPos
-
compareTo
- 指定者:
compareTo在接口中Comparable<BlockPos>
-
toString
-
write
- 指定者:
write在类中ReadWriteObject
-
read
- 指定者:
read在类中ReadWriteObject
-