From 24f140d1f43498b5e40db23d834f9d1f597a9bce Mon Sep 17 00:00:00 2001 From: Dinnerbone Date: Tue, 1 Feb 2011 10:20:18 +0000 Subject: [PATCH] Implemented VEHICLE_UPDATE --- src/main/java/net/minecraft/server/EntityBoat.java | 5 +++-- src/main/java/net/minecraft/server/EntityMinecart.java | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/minecraft/server/EntityBoat.java b/src/main/java/net/minecraft/server/EntityBoat.java index b9a53712a9..9bb96e2190 100644 --- a/src/main/java/net/minecraft/server/EntityBoat.java +++ b/src/main/java/net/minecraft/server/EntityBoat.java @@ -14,6 +14,7 @@ import org.bukkit.event.vehicle.VehicleCreateEvent; import org.bukkit.event.vehicle.VehicleDamageEvent; import org.bukkit.event.vehicle.VehicleEnterEvent; import org.bukkit.event.vehicle.VehicleEntityCollisionEvent; +import org.bukkit.event.vehicle.VehicleEvent; import org.bukkit.event.vehicle.VehicleMoveEvent; // CraftBukkit end @@ -326,9 +327,9 @@ public class EntityBoat extends Entity { CraftWorld world = ((WorldServer) this.world).getWorld(); 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); + Vehicle vehicle = (Vehicle) this.getBukkitEntity(); + server.getPluginManager().callEvent(new VehicleEvent(Type.VEHICLE_UPDATE, vehicle)); if (!from.equals(to)) { - Vehicle vehicle = (Vehicle) this.getBukkitEntity(); - VehicleMoveEvent event = new VehicleMoveEvent(Type.VEHICLE_MOVE, vehicle, from, to); server.getPluginManager().callEvent(event); } diff --git a/src/main/java/net/minecraft/server/EntityMinecart.java b/src/main/java/net/minecraft/server/EntityMinecart.java index 89e86ac152..e9db574af3 100644 --- a/src/main/java/net/minecraft/server/EntityMinecart.java +++ b/src/main/java/net/minecraft/server/EntityMinecart.java @@ -480,14 +480,14 @@ public class EntityMinecart extends Entity implements IInventory { this.b(this.yaw, this.pitch); - // CraftBukkit start + // CraftBukkit start CraftServer server = ((WorldServer) this.world).getServer(); CraftWorld world = ((WorldServer) this.world).getWorld(); 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); + Vehicle vehicle = (Vehicle) this.getBukkitEntity(); + server.getPluginManager().callEvent(new VehicleEvent(Type.VEHICLE_UPDATE, vehicle)); if (!from.equals(to)) { - Vehicle vehicle = (Vehicle) this.getBukkitEntity(); - VehicleMoveEvent event = new VehicleMoveEvent(Type.VEHICLE_MOVE, vehicle, from, to); server.getPluginManager().callEvent(event); }