类的使用
org.bukkit.util.Vector
使用Vector的程序包
程序包
说明
Bukkit API的顶级程序包, 包含通用的API类和接口.
用于操作在
世界内的三位像素(方块),包括一些特定的状态.专门用于处理插件运行时配置的类.
为在
世界内存在的非三维像素单位(实体)提供的接口,包含玩家、怪物、抛射物等.代表一个抛射物的抛射源的类的集合.
提供多种目的和单一目的的类以简化各种编程概念.
-
org.bukkit中Vector的使用
返回Vector的org.bukkit中的方法参数类型为Vector的org.bukkit中的方法修饰符和类型方法说明将本位置的坐标加上一个向量的坐标.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) 在给定的位置生成指定类型的箭矢实体.从本位置的坐标中减去向量的坐标. -
org.bukkit.block中Vector的使用
返回Vector的org.bukkit.block中的方法参数类型为Vector的org.bukkit.block中的方法 -
org.bukkit.configuration中Vector的使用
参数类型为Vector的org.bukkit.configuration中的方法 -
org.bukkit.entity中Vector的使用
返回Vector的org.bukkit.entity中的方法修饰符和类型方法说明Fireball.getAcceleration()获取此火球的加速度.Minecart.getDerailedVelocityMod()获取脱轨时的速率修正值.Fireball.getDirection()已过时。Minecart.getFlyingVelocityMod()获取飞行中的速率修正值.Entity.getVelocity()获取此实体的速度.Vehicle.getVelocity()获取载具的速度.参数类型为Vector的org.bukkit.entity中的方法修饰符和类型方法说明voidFireball.setAcceleration(@NotNull Vector acceleration) 设置火球的加速度.voidMinecart.setDerailedVelocityMod(@NotNull Vector derailed) 设置脱轨时的速率修正值.voidFireball.setDirection(@NotNull Vector direction) 设置火球飞行的方向.voidMinecart.setFlyingVelocityMod(@NotNull Vector flying) 设置飞行中的速率修正值.voidEntity.setVelocity(@NotNull Vector velocity) 设置此实体的速度 (单位: 米每tick).voidVehicle.setVelocity(@NotNull Vector vel) 设置载具的速度(单位: 米/刻). -
org.bukkit.event.block中Vector的使用
返回Vector的org.bukkit.event.block中的方法参数类型为Vector的org.bukkit.event.block中的方法参数类型为Vector的org.bukkit.event.block中的构造器 -
org.bukkit.event.entity中Vector的使用
修饰符和类型方法说明EntityPortalExitEvent.getAfter()获取实体退出传送门后的速度的副本.EntityPortalExitEvent.getBefore()获取实体进入传送门前的速度的副本.EntityKnockbackEvent.getFinalKnockback()获取将应用于实体的最终击退力度。EntityKnockbackEvent.getKnockback()获取将应用于实体的原始击退力度。参数类型为Vector的org.bukkit.event.entity中的方法修饰符和类型方法说明void设置实体退出传送门后的速度.voidEntityKnockbackEvent.setFinalKnockback(@NotNull Vector knockback) 设置将应用于实体的击退力度。参数类型为Vector的org.bukkit.event.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()获取玩家交互方块时的精确位置, 在Action.RIGHT_CLICK_BLOCK之外的情况下为 null.PlayerRiptideEvent.getVelocity()获取因本次激流而施加给玩家的速度向量.PlayerVelocityEvent.getVelocity()得到玩家目前的移动速度.参数类型为Vector的org.bukkit.event.player中的方法参数类型为Vector的org.bukkit.event.player中的构造器限定符构造器说明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的使用
参数类型为Vector的org.bukkit.projectiles中的方法修饰符和类型方法说明<T extends Projectile>
TProjectileSource.launchProjectile(@NotNull Class<? extends T> projectile, @Nullable Vector velocity) 让ProjectileSource以一个初始速度向量发射Projectile。 -
org.bukkit.util中Vector的使用
返回Vector的org.bukkit.util中的方法修饰符和类型方法说明将本向量的坐标加上另一个向量的坐标.Vector.clone()克隆此向量.将本向量的坐标全部设为另一个向量的坐标.Vector.crossProduct(@NotNull Vector o) 将本向量的坐标设为两个向量的叉积.Vector.deserialize(@NotNull Map<String, Object> args) 将本向量的坐标除以另一个向量的坐标.获取一个坐标与提供的 JOMLVector3d匹配的向量.获取一个坐标与提供的 JOMLVector3dc匹配的向量.获取一个坐标与提供的 JOMLVector3f匹配的向量.获取一个坐标与提供的 JOMLVector3fc匹配的向量.获取一个坐标与提供的 JOMLVector3i匹配的向量.获取一个坐标与提供的 JOMLVector3ic匹配的向量.BoundingBox.getCenter()获取边界框的中心。Vector.getCrossProduct(@NotNull Vector o) 返回一个新的向量,其坐标为本向量与另一个向量的叉积.RayTraceResult.getHitPosition()获取命中的精确位置.BoundingBox.getMax()获取最大角作为向量。Vector.getMaximum(@NotNull Vector v1, @NotNull Vector v2) 获取两个向量坐标中更大的那些坐标组成的新向量.Vector.getMidpoint(@NotNull Vector other) 获取一个新的向量,它的值为本向量和另一个向量间的连线的中点.BoundingBox.getMin()获取最小角作为向量。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) 将向量绕给定的任意轴在三维空间中旋转.Vector.rotateAroundNonUnitAxis(@NotNull Vector axis, double angle) 将向量绕给定的任意轴在三维空间中旋转.Vector.rotateAroundX(double angle) 将向量绕X轴旋转.Vector.rotateAroundY(double angle) 将向量绕Y轴旋转.Vector.rotateAroundZ(double angle) 将向量绕Z轴旋转.Vector.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()将本向量设为原点向量.参数类型为Vector的org.bukkit.util中的方法修饰符和类型方法说明将本向量的坐标加上另一个向量的坐标.float获取本向量与另一个向量的夹角,用弧度表示.boolean检查此边界框是否包含指定位置。boolean检查此边界框是否完全包含给定角定义的边界框。将本向量的坐标全部设为另一个向量的坐标.Vector.crossProduct(@NotNull Vector o) 将本向量的坐标设为两个向量的叉积.double获取本向量与与另一个向量之间的距离.doubleVector.distanceSquared(@NotNull Vector o) 获取本向量与与另一个向量之间的距离的平方.将本向量的坐标除以另一个向量的坐标.double计算本向量与另一个向量的点积,定义为x1*x2+y1*y2+z1*z2.在正负方向上按给定值均匀扩展此边界框。在指定方向上扩展此边界框。BoundingBox.expandDirectional(@NotNull Vector 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包围盒中.booleanVector.isInSphere(@NotNull Vector origin, double radius) 判断本向量是否在一个球形空间中.设置本向量的坐标为两个向量连线的中点.将本向量的坐标乘上另一个向量的坐标.static @NotNull BoundingBox使用给定中心和范围创建新的边界框。static @NotNull BoundingBox使用给定向量的坐标作为角创建新的边界框。boolean检查此边界框是否与给定角定义的边界框重叠。计算此边界框与指定线段的交点。Vector.rotateAroundAxis(@NotNull Vector axis, double angle) 将向量绕给定的任意轴在三维空间中旋转.Vector.rotateAroundNonUnitAxis(@NotNull Vector axis, double angle) 将向量绕给定的任意轴在三维空间中旋转.Shifts this bounding box by the given amounts.从本向量的坐标中减去另一个向量的坐标.Expands this bounding box to contain (or border) the specified position.参数类型为Vector的org.bukkit.util中的构造器限定符构造器说明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()的值