类的使用
org.bukkit.util.Vector
程序包
说明
Bukkit API的顶级程序包, 包含通用的API类和接口.
用于操作在
世界
内的三位像素(方块),包括一些特定的状态.专门用于处理插件运行时配置的类.
为在
世界
内存在的非三维像素单位(实体)提供的接口,包含玩家、怪物、抛射物等.代表一个抛射物的抛射源的类的集合.
提供多种目的和单一目的的类以简化各种编程概念.
-
org.bukkit中Vector的使用
修饰符和类型方法说明将本位置的坐标加上一个向量的坐标.World.rayTrace
(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, double raySize, @Nullable Predicate<? super Entity> filter) 执行射线跟踪, 检查方块碰撞和实体碰撞.World.rayTraceBlocks
(@NotNull Location start, @NotNull Vector direction, double maxDistance) 执行射线跟踪, 使用方块的精确碰撞形状来检查方块碰撞.World.rayTraceBlocks
(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode) 执行射线跟踪, 使用方块的精确碰撞形状来检查方块碰撞.World.rayTraceBlocks
(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks) 执行射线跟踪, 使用方块的精确碰撞形状来检查方块碰撞.World.rayTraceEntities
(@NotNull Location start, @NotNull Vector direction, double maxDistance) 执行检查实体碰撞的射线跟踪.World.rayTraceEntities
(@NotNull Location start, @NotNull Vector direction, double maxDistance, double raySize) 执行检查实体碰撞的射线跟踪.World.rayTraceEntities
(@NotNull Location start, @NotNull Vector direction, double maxDistance, double raySize, @Nullable Predicate<? super Entity> filter) 执行检查实体碰撞的射线跟踪.World.rayTraceEntities
(@NotNull Location start, @NotNull Vector direction, double maxDistance, @Nullable Predicate<? super Entity> filter) 执行检查实体碰撞的射线跟踪.Location.setDirection
(@NotNull Vector vector) World.spawnArrow
(@NotNull Location location, @NotNull Vector direction, float speed, float spread) <T extends AbstractArrow>
TWorld.spawnArrow
(@NotNull Location location, @NotNull Vector direction, float speed, float spread, @NotNull Class<T> clazz) Creates an arrow entity of the given class at the givenLocation
从本位置的坐标中减去向量的坐标. -
org.bukkit.block中Vector的使用
修饰符和类型方法说明int
Gets the appropriate slot based on a vector relative to this block.
Will return -1 if the given vector is not within the bounds of any slot.Block.rayTrace
(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode) Performs a ray trace that checks for collision with this specific block in its current state using its precise collision shape. -
org.bukkit.configuration中Vector的使用
-
org.bukkit.entity中Vector的使用
修饰符和类型方法说明Fireball.getAcceleration()
Retrieve the acceleration of this fireball.Minecart.getDerailedVelocityMod()
Gets the derailed velocity modifier.Fireball.getDirection()
已过时。Minecart.getFlyingVelocityMod()
Gets the flying velocity modifier.Entity.getVelocity()
获取此实体的速度.Vehicle.getVelocity()
Gets the vehicle's velocity.修饰符和类型方法说明void
Fireball.setAcceleration
(@NotNull Vector acceleration) Sets the acceleration of the fireball.void
Minecart.setDerailedVelocityMod
(@NotNull Vector derailed) Sets the derailed velocity modifier.void
Fireball.setDirection
(@NotNull Vector direction) Sets the direction the fireball should be flying towards.void
Minecart.setFlyingVelocityMod
(@NotNull Vector flying) Sets the flying velocity modifier.void
Entity.setVelocity
(@NotNull Vector velocity) 设置此实体的速度 (单位: 米每tick).void
Vehicle.setVelocity
(@NotNull Vector vel) Sets the vehicle's velocity in meters per tick. -
org.bukkit.event.block中Vector的使用
-
org.bukkit.event.entity中Vector的使用
修饰符和类型方法说明EntityPortalExitEvent.getAfter()
获取实体退出传送门后的速度的副本.EntityPortalExitEvent.getBefore()
获取实体进入传送门前的速度的副本.EntityKnockbackEvent.getFinalKnockback()
Gets the force that will be applied to the entity.EntityKnockbackEvent.getKnockback()
Gets the raw knockback force that will be applied to the entity.修饰符和类型方法说明void
设置实体退出传送门后的速度.void
EntityKnockbackEvent.setFinalKnockback
(@NotNull Vector knockback) Sets the force that will be applied to the entity.限定符构造器说明EntityKnockbackByEntityEvent
(@NotNull LivingEntity entity, @NotNull Entity source, @NotNull EntityKnockbackEvent.KnockbackCause cause, double force, @NotNull Vector rawKnockback, @NotNull Vector knockback) EntityKnockbackEvent
(@NotNull LivingEntity entity, @NotNull EntityKnockbackEvent.KnockbackCause cause, double force, @NotNull Vector rawKnockback, @NotNull Vector knockback) EntityPortalExitEvent
(@NotNull Entity entity, @NotNull Location from, @NotNull Location to, @NotNull Vector before, @NotNull Vector after) -
org.bukkit.event.player中Vector的使用
修饰符和类型方法说明PlayerInteractAtEntityEvent.getClickedPosition()
PlayerInteractEvent.getClickedPosition()
Gets the exact position on the block the player interacted with, this will be null outside ofAction.RIGHT_CLICK_BLOCK
.PlayerRiptideEvent.getVelocity()
Get the velocity applied to the player as a result of this riptide.PlayerVelocityEvent.getVelocity()
得到玩家目前的移动速度.限定符构造器说明PlayerInteractAtEntityEvent
(@NotNull Player who, @NotNull Entity clickedEntity, @NotNull Vector position) PlayerInteractAtEntityEvent
(@NotNull Player who, @NotNull Entity clickedEntity, @NotNull Vector position, @NotNull EquipmentSlot hand) PlayerInteractEvent
(@NotNull Player who, @NotNull Action action, @Nullable ItemStack item, @Nullable Block clickedBlock, @NotNull BlockFace clickedFace, @Nullable EquipmentSlot hand, @Nullable Vector clickedPosition) PlayerVelocityEvent
(@NotNull Player player, @NotNull Vector velocity) -
org.bukkit.projectiles中Vector的使用
修饰符和类型方法说明<T extends Projectile>
TProjectileSource.launchProjectile
(@NotNull Class<? extends T> projectile, @Nullable Vector velocity) 让ProjectileSource以一个初始速度向量发射Projectile
。 -
org.bukkit.util中Vector的使用
修饰符和类型方法说明将本向量的坐标加上另一个向量的坐标.Vector.clone()
克隆此向量.将本向量的坐标全部设为另一个向量的坐标.Vector.crossProduct
(@NotNull Vector o) 将本向量的坐标设为两个向量的叉积.Vector.deserialize
(@NotNull Map<String, Object> args) 将本向量的坐标除以另一个向量的坐标.Gets a vector with components that match the provided JOMLVector3d
.Gets a vector with components that match the provided JOMLVector3dc
.Gets a vector with components that match the provided JOMLVector3f
.Gets a vector with components that match the provided JOMLVector3fc
.Gets a vector with components that match the provided JOMLVector3i
.Gets a vector with components that match the provided JOMLVector3ic
.BoundingBox.getCenter()
Gets the center of the bounding box.Vector.getCrossProduct
(@NotNull Vector o) 返回一个新的向量,其坐标为本向量与另一个向量的叉积.RayTraceResult.getHitPosition()
获取命中的精确位置.BoundingBox.getMax()
Gets the maximum corner as vector.Vector.getMaximum
(@NotNull Vector v1, @NotNull Vector v2) 获取两个向量坐标中更大的那些坐标组成的新向量.Vector.getMidpoint
(@NotNull Vector other) 获取一个新的向量,它的值为本向量和另一个向量间的连线的中点.BoundingBox.getMin()
Gets the minimum corner as vector.Vector.getMinimum
(@NotNull Vector v1, @NotNull Vector v2) 获取两个向量坐标中更小的那些坐标组成的新向量.Vector.getRandom()
获取一个随机向量,其坐标值均为0到1之间(不含1).设置本向量的坐标为两个向量连线的中点.Vector.multiply
(double m) 向量的数乘,将向量在所有轴上扩展某个倍数.Vector.multiply
(float m) 向量的数乘,将向量在所有轴上扩展某个倍数.Vector.multiply
(int m) 向量的数乘,将向量在所有轴上扩展某个倍数.将本向量的坐标乘上另一个向量的坐标.Vector.normalize()
将本向量转化为单位向量(模为1的向量).Vector.rotateAroundAxis
(@NotNull Vector axis, double angle) Rotates the vector around a given arbitrary axis in 3 dimensional space.Vector.rotateAroundNonUnitAxis
(@NotNull Vector axis, double angle) Rotates the vector around a given arbitrary axis in 3 dimensional space.Vector.rotateAroundX
(double angle) Rotates the vector around the x axis.Vector.rotateAroundY
(double angle) Rotates the vector around the y axis.Vector.rotateAroundZ
(double angle) Rotates the vector around the z axisVector.setX
(double x) 设置X坐标.Vector.setX
(float x) 设置X坐标.Vector.setX
(int x) 设置X坐标.Vector.setY
(double y) 设置Y坐标.Vector.setY
(float y) 设置Y坐标.Vector.setY
(int y) 设置Y坐标.Vector.setZ
(double z) 设置Z坐标.Vector.setZ
(float z) 设置Z坐标.Vector.setZ
(int z) 设置Z坐标.从本向量的坐标中减去另一个向量的坐标.Vector.zero()
将本向量设为原点向量.修饰符和类型方法说明将本向量的坐标加上另一个向量的坐标.float
获取本向量与另一个向量的夹角,用弧度表示.boolean
Checks if this bounding box contains the specified position.boolean
Checks if this bounding box fully contains the bounding box that is defined by the given corners.将本向量的坐标全部设为另一个向量的坐标.Vector.crossProduct
(@NotNull Vector o) 将本向量的坐标设为两个向量的叉积.double
获取本向量与与另一个向量之间的距离.double
Vector.distanceSquared
(@NotNull Vector o) 获取本向量与与另一个向量之间的距离的平方.将本向量的坐标除以另一个向量的坐标.double
计算本向量与另一个向量的点积,定义为x1*x2+y1*y2+z1*z2.Expands this bounding box uniformly by the given values in both positive and negative directions.Expands this bounding box in the specified direction.BoundingBox.expandDirectional
(@NotNull Vector direction) Expands this bounding box in the specified direction.Vector.getCrossProduct
(@NotNull Vector o) 返回一个新的向量,其坐标为本向量与另一个向量的叉积.Vector.getMaximum
(@NotNull Vector v1, @NotNull Vector v2) 获取两个向量坐标中更大的那些坐标组成的新向量.Vector.getMidpoint
(@NotNull Vector other) 获取一个新的向量,它的值为本向量和另一个向量间的连线的中点.Vector.getMinimum
(@NotNull Vector v1, @NotNull Vector v2) 获取两个向量坐标中更小的那些坐标组成的新向量.boolean
判断本向量是否在一个AABB包围盒中.boolean
Vector.isInSphere
(@NotNull Vector origin, double radius) 判断本向量是否在一个球形空间中.设置本向量的坐标为两个向量连线的中点.将本向量的坐标乘上另一个向量的坐标.static @NotNull BoundingBox
Creates a new bounding box using the given center and extents.static @NotNull BoundingBox
Creates a new bounding box using the coordinates of the given vectors as corners.boolean
Checks if this bounding box overlaps with the bounding box that is defined by the given corners.Calculates the intersection of this bounding box with the specified line segment.Vector.rotateAroundAxis
(@NotNull Vector axis, double angle) Rotates the vector around a given arbitrary axis in 3 dimensional space.Vector.rotateAroundNonUnitAxis
(@NotNull Vector axis, double angle) Rotates the vector around a given arbitrary axis in 3 dimensional space.Shifts this bounding box by the given amounts.从本向量的坐标中减去另一个向量的坐标.Expands this bounding box to contain (or border) the specified position.限定符构造器说明BlockIterator
(@NotNull World world, @NotNull Vector start, @NotNull Vector direction, double yOffset, int maxDistance) BlockIterator的构造函数.BlockVector
(@NotNull Vector vec) 使用另一个向量来创建向量.RayTraceResult
(@NotNull Vector hitPosition) 创建一个射线跟踪器结果.RayTraceResult
(@NotNull Vector hitPosition, @Nullable BlockFace hitBlockFace) 创建一个射线跟踪器结果.RayTraceResult
(@NotNull Vector hitPosition, @Nullable Block hitBlock, @Nullable BlockFace hitBlockFace) 创建一个射线跟踪器结果.RayTraceResult
(@NotNull Vector hitPosition, @Nullable Entity hitEntity) 创建一个射线跟踪器结果.RayTraceResult
(@NotNull Vector hitPosition, @Nullable Entity hitEntity, @Nullable BlockFace hitBlockFace) 创建一个射线跟踪器结果.
Fireball.getAcceleration()