程序包 org.bukkit.util
类 BlockVector
java.lang.Object
org.bukkit.util.Vector
org.bukkit.util.BlockVector
- 所有已实现的接口:
Cloneable
,ConfigurationSerializable
这是一个带有可以向下取整XYZ坐标函数的向量类,就像WorldEdit中的BlockVector.
BlockVector可以用于HashSet和HashMap.注意BlockVector是可变的,
但重要的是请确保BlockVector被扔到一个HashSet或HashMap后就不要修改它了.
原文:A vector with a hash function that floors the X, Y, Z components, a la BlockVector in WorldEdit. BlockVectors can be used in hash sets and hash maps. Be aware that BlockVectors are mutable, but it is important that BlockVectors are never changed once put into a hash set or hash map.
-
字段概要
-
构造器概要
构造器说明使用原点坐标来创建向量.BlockVector
(double x, double y, double z) 使用给定双精度浮点数坐标来创建向量.BlockVector
(float x, float y, float z) 使用给定单精度浮点数坐标来创建向量.BlockVector
(int x, int y, int z) 使用给定整数坐标来创建向量.BlockVector
(@NotNull Vector vec) 使用另一个向量来创建向量. -
方法概要
修饰符和类型方法说明clone()
克隆生成新的方块向量.static @NotNull BlockVector
deserialize
(@NotNull Map<String, Object> args) boolean
检查是否同另一个对象相等.int
hashCode()
返回这个向量的哈希码.从类继承的方法 org.bukkit.util.Vector
add, angle, checkFinite, copy, crossProduct, distance, distanceSquared, divide, dot, fromJOML, fromJOML, fromJOML, fromJOML, fromJOML, fromJOML, getBlockX, getBlockY, getBlockZ, getCrossProduct, getEpsilon, getMaximum, getMidpoint, getMinimum, getRandom, getX, getY, getZ, isInAABB, isInSphere, isNormalized, isZero, length, lengthSquared, midpoint, multiply, multiply, multiply, multiply, normalize, rotateAroundAxis, rotateAroundNonUnitAxis, rotateAroundX, rotateAroundY, rotateAroundZ, serialize, setX, setX, setX, setY, setY, setY, setZ, setZ, setZ, subtract, toBlockVector, toLocation, toLocation, toString, toVector3d, toVector3f, toVector3i, toVector3i, zero
-
构造器详细资料
-
BlockVector
public BlockVector()使用原点坐标来创建向量.原文:Construct the vector with all components as 0.
-
BlockVector
使用另一个向量来创建向量.原文:Construct the vector with another vector.
- 参数:
vec
- 另一个向量。
-
BlockVector
public BlockVector(int x, int y, int z) 使用给定整数坐标来创建向量.原文:Construct the vector with provided integer components.
- 参数:
x
- X坐标y
- Y坐标z
- Z坐标
-
BlockVector
public BlockVector(double x, double y, double z) 使用给定双精度浮点数坐标来创建向量.原文:Construct the vector with provided double components.
- 参数:
x
- X坐标y
- Y坐标z
- Z坐标
-
BlockVector
public BlockVector(float x, float y, float z) 使用给定单精度浮点数坐标来创建向量.原文:Construct the vector with provided float components.
- 参数:
x
- X坐标y
- Y坐标z
- Z坐标
-
-
方法详细资料
-
equals
检查是否同另一个对象相等.原文:Checks if another object is equivalent.
-
hashCode
public int hashCode()返回这个向量的哈希码.原文:Returns a hash code for this vector.
-
clone
克隆生成新的方块向量.原文:Get a new block vector.
-
deserialize
-