mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-02 14:58:43 +01:00
Fixed VEHICLE_MOVE
This commit is contained in:
parent
408ed37a01
commit
2b0ab5a130
2 changed files with 11 additions and 9 deletions
|
@ -324,13 +324,14 @@ public class EntityBoat extends Entity {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
CraftServer server = ((WorldServer) this.world).getServer();
|
CraftServer server = ((WorldServer) this.world).getServer();
|
||||||
CraftWorld world = ((WorldServer) this.world).getWorld();
|
CraftWorld world = ((WorldServer) this.world).getWorld();
|
||||||
Type eventType = Type.VEHICLE_MOVE;
|
|
||||||
Vehicle vehicle = (Vehicle) this.getBukkitEntity();
|
|
||||||
Location from = new Location(world, prevX, prevY, prevZ, prevYaw, prevPitch);
|
Location from = new Location(world, prevX, prevY, prevZ, prevYaw, prevPitch);
|
||||||
Location to = new Location(world, this.locX, this.locY, this.locZ, this.yaw, this.pitch);
|
Location to = new Location(world, this.locX, this.locY, this.locZ, this.yaw, this.pitch);
|
||||||
|
if (!from.equals(to)) {
|
||||||
|
Vehicle vehicle = (Vehicle) this.getBukkitEntity();
|
||||||
|
|
||||||
VehicleMoveEvent event = new VehicleMoveEvent(eventType, vehicle, from, to);
|
VehicleMoveEvent event = new VehicleMoveEvent(Type.VEHICLE_MOVE, vehicle, from, to);
|
||||||
server.getPluginManager().callEvent(event);
|
server.getPluginManager().callEvent(event);
|
||||||
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
List list = this.world.b((Entity) this, this.boundingBox.b(0.20000000298023224D, 0.0D, 0.20000000298023224D));
|
List list = this.world.b((Entity) this, this.boundingBox.b(0.20000000298023224D, 0.0D, 0.20000000298023224D));
|
||||||
|
|
|
@ -483,13 +483,14 @@ public class EntityMinecart extends Entity implements IInventory {
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
CraftServer server = ((WorldServer) this.world).getServer();
|
CraftServer server = ((WorldServer) this.world).getServer();
|
||||||
CraftWorld world = ((WorldServer) this.world).getWorld();
|
CraftWorld world = ((WorldServer) this.world).getWorld();
|
||||||
Type eventType = Type.VEHICLE_MOVE;
|
|
||||||
Vehicle vehicle = (Vehicle) this.getBukkitEntity();
|
|
||||||
Location from = new Location(world, prevX, prevY, prevZ, prevYaw, prevPitch);
|
Location from = new Location(world, prevX, prevY, prevZ, prevYaw, prevPitch);
|
||||||
Location to = new Location(world, this.locX, this.locY, this.locZ, this.yaw, this.pitch);
|
Location to = new Location(world, this.locX, this.locY, this.locZ, this.yaw, this.pitch);
|
||||||
|
if (!from.equals(to)) {
|
||||||
|
Vehicle vehicle = (Vehicle) this.getBukkitEntity();
|
||||||
|
|
||||||
VehicleMoveEvent event = new VehicleMoveEvent(eventType , vehicle , from, to);
|
VehicleMoveEvent event = new VehicleMoveEvent(Type.VEHICLE_MOVE, vehicle, from, to);
|
||||||
server.getPluginManager().callEvent(event);
|
server.getPluginManager().callEvent(event);
|
||||||
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
List list = this.world.b((Entity) this, this.boundingBox.b(0.20000000298023224D, 0.0D, 0.20000000298023224D));
|
List list = this.world.b((Entity) this, this.boundingBox.b(0.20000000298023224D, 0.0D, 0.20000000298023224D));
|
||||||
|
|
Loading…
Add table
Reference in a new issue