类的使用
org.bukkit.util.Vector
使用Vector的程序包
程序包
说明
Bukkit的常用类.
专门用于处理插件运行时配置的类.
为在
世界
内存在的非三维像素单位(实体)提供的接口,包含玩家、怪物、抛射物等.代表一个抛射物的抛射源的类的集合.
提供多种目的和单一目的的类以简化各种编程概念.
-
org.bukkit中Vector的使用
返回Vector的org.bukkit中的方法参数类型为Vector的org.bukkit中的方法修饰符和类型方法说明将本位置的坐标加上一个向量的坐标.Location.setDirection
(Vector vector) World.spawnArrow
(Location location, Vector direction, float speed, float spread) <T extends Arrow>
TWorld.spawnArrow
(Location location, Vector direction, float speed, float spread, Class<T> clazz) Creates an arrow entity of the given class at the givenLocation
从本位置的坐标中减去向量的坐标. -
org.bukkit.configuration中Vector的使用
参数类型为Vector的org.bukkit.configuration中的方法 -
org.bukkit.entity中Vector的使用
返回Vector的org.bukkit.entity中的方法修饰符和类型方法说明Minecart.getDerailedVelocityMod()
Gets the derailed velocity modifier.Fireball.getDirection()
Retrieve the direction this fireball is heading towardMinecart.getFlyingVelocityMod()
Gets the flying velocity modifier.Entity.getVelocity()
Gets this entity's current velocityVehicle.getVelocity()
Gets the vehicle's velocity.参数类型为Vector的org.bukkit.entity中的方法修饰符和类型方法说明void
Minecart.setDerailedVelocityMod
(Vector derailed) Sets the derailed velocity modifier.void
Fireball.setDirection
(Vector direction) Fireballs fly straight and do not take setVelocity(...) well.void
Minecart.setFlyingVelocityMod
(Vector flying) Sets the flying velocity modifier.void
Entity.setVelocity
(Vector velocity) Sets this entity's velocityvoid
Vehicle.setVelocity
(Vector vel) Sets the vehicle's velocity. -
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()
Gets a copy of the velocity that the entity will have after exiting the portal.EntityPortalExitEvent.getBefore()
Gets a copy of the velocity that the entity has before entering the portal.参数类型为Vector的org.bukkit.event.entity中的方法修饰符和类型方法说明void
Sets the velocity that the entity will have after exiting the portal.参数类型为Vector的org.bukkit.event.entity中的构造器 -
org.bukkit.event.player中Vector的使用
修饰符和类型方法说明PlayerInteractAtEntityEvent.getClickedPosition()
PlayerVelocityEvent.getVelocity()
得到玩家目前的移动速度.参数类型为Vector的org.bukkit.event.player中的方法参数类型为Vector的org.bukkit.event.player中的构造器限定符构造器说明PlayerInteractAtEntityEvent
(Player who, Entity clickedEntity, Vector position) PlayerInteractAtEntityEvent
(Player who, Entity clickedEntity, Vector position, EquipmentSlot hand) PlayerVelocityEvent
(Player player, Vector velocity) -
org.bukkit.projectiles中Vector的使用
参数类型为Vector的org.bukkit.projectiles中的方法修饰符和类型方法说明<T extends Projectile>
TProjectileSource.launchProjectile
(Class<? extends T> projectile, Vector velocity) 让ProjectileSource以一个初始速度向量发射Projectile
。 -
org.bukkit.util中Vector的使用
返回Vector的org.bukkit.util中的方法修饰符和类型方法说明将本向量的坐标加上另一个向量的坐标.Vector.clone()
克隆此向量.将本向量的坐标全部设为另一个向量的坐标.Vector.crossProduct
(Vector o) 将本向量的坐标设为两个向量的叉积.static Vector
Vector.deserialize
(Map<String, Object> args) 将本向量的坐标除以另一个向量的坐标.Vector.getCrossProduct
(Vector o) 返回一个新的向量,其坐标为本向量与另一个向量的叉积.static Vector
Vector.getMaximum
(Vector v1, Vector v2) 获取两个向量坐标中更大的那些坐标组成的新向量.Vector.getMidpoint
(Vector other) 获取一个新的向量,它的值为本向量和另一个向量间的连线的中点.static Vector
Vector.getMinimum
(Vector v1, Vector v2) 获取两个向量坐标中更小的那些坐标组成的新向量.static Vector
Vector.getRandom()
获取一个随机向量,其坐标值均为0到1之间(不含1).设置本向量的坐标为两个向量连线的中点.Vector.multiply
(double m) 向量的数乘,将向量在所有轴上扩展某个倍数.Vector.multiply
(float m) 向量的数乘,将向量在所有轴上扩展某个倍数.Vector.multiply
(int m) 向量的数乘,将向量在所有轴上扩展某个倍数.将本向量的坐标乘上另一个向量的坐标.Vector.normalize()
将本向量转化为单位向量(模为1的向量).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
获取本向量与另一个向量的夹角,用弧度表示.将本向量的坐标全部设为另一个向量的坐标.Vector.crossProduct
(Vector o) 将本向量的坐标设为两个向量的叉积.double
获取本向量与与另一个向量之间的距离.double
Vector.distanceSquared
(Vector o) 获取本向量与与另一个向量之间的距离的平方.将本向量的坐标除以另一个向量的坐标.double
计算本向量与另一个向量的点积,定义为x1*x2+y1*y2+z1*z2.Vector.getCrossProduct
(Vector o) 返回一个新的向量,其坐标为本向量与另一个向量的叉积.static Vector
Vector.getMaximum
(Vector v1, Vector v2) 获取两个向量坐标中更大的那些坐标组成的新向量.Vector.getMidpoint
(Vector other) 获取一个新的向量,它的值为本向量和另一个向量间的连线的中点.static Vector
Vector.getMinimum
(Vector v1, Vector v2) 获取两个向量坐标中更小的那些坐标组成的新向量.boolean
判断本向量是否在一个AABB包围盒中.boolean
Vector.isInSphere
(Vector origin, double radius) 判断本向量是否在一个球形空间中.设置本向量的坐标为两个向量连线的中点.将本向量的坐标乘上另一个向量的坐标.从本向量的坐标中减去另一个向量的坐标.参数类型为Vector的org.bukkit.util中的构造器限定符构造器说明BlockIterator
(World world, Vector start, Vector direction, double yOffset, int maxDistance) BlockIterator的构造函数.BlockVector
(Vector vec) 使用另一个向量来创建向量.