summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorDinnerbone <dinnerbone@dinnerbone.com>2011-02-01 10:14:59 +0000
committerDinnerbone <dinnerbone@dinnerbone.com>2011-02-01 10:14:59 +0000
commit2b0ab5a1307f0dd76963dd331c526fdb714e48a5 (patch)
treebb81600c1dcd86285c83aa0c22bb0091dc0664ba /src/main
parent408ed37a01f81ba0b25313c6c538010a7f6fd3e6 (diff)
downloadcraftbukkit-2b0ab5a1307f0dd76963dd331c526fdb714e48a5.tar
craftbukkit-2b0ab5a1307f0dd76963dd331c526fdb714e48a5.tar.gz
craftbukkit-2b0ab5a1307f0dd76963dd331c526fdb714e48a5.tar.lz
craftbukkit-2b0ab5a1307f0dd76963dd331c526fdb714e48a5.tar.xz
craftbukkit-2b0ab5a1307f0dd76963dd331c526fdb714e48a5.zip
Fixed VEHICLE_MOVE
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/net/minecraft/server/EntityBoat.java9
-rw-r--r--src/main/java/net/minecraft/server/EntityMinecart.java11
2 files changed, 11 insertions, 9 deletions
diff --git a/src/main/java/net/minecraft/server/EntityBoat.java b/src/main/java/net/minecraft/server/EntityBoat.java
index 67923166..b9a53712 100644
--- a/src/main/java/net/minecraft/server/EntityBoat.java
+++ b/src/main/java/net/minecraft/server/EntityBoat.java
@@ -324,13 +324,14 @@ public class EntityBoat extends Entity {
// CraftBukkit start
CraftServer server = ((WorldServer) this.world).getServer();
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 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);
- server.getPluginManager().callEvent(event);
+ VehicleMoveEvent event = new VehicleMoveEvent(Type.VEHICLE_MOVE, vehicle, from, to);
+ server.getPluginManager().callEvent(event);
+ }
// CraftBukkit end
List list = this.world.b((Entity) this, this.boundingBox.b(0.20000000298023224D, 0.0D, 0.20000000298023224D));
diff --git a/src/main/java/net/minecraft/server/EntityMinecart.java b/src/main/java/net/minecraft/server/EntityMinecart.java
index c328fd8c..89e86ac1 100644
--- a/src/main/java/net/minecraft/server/EntityMinecart.java
+++ b/src/main/java/net/minecraft/server/EntityMinecart.java
@@ -480,16 +480,17 @@ 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();
- Type eventType = Type.VEHICLE_MOVE;
- Vehicle vehicle = (Vehicle) this.getBukkitEntity();
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);
+ if (!from.equals(to)) {
+ Vehicle vehicle = (Vehicle) this.getBukkitEntity();
- VehicleMoveEvent event = new VehicleMoveEvent(eventType , vehicle , from, to);
- server.getPluginManager().callEvent(event);
+ VehicleMoveEvent event = new VehicleMoveEvent(Type.VEHICLE_MOVE, vehicle, from, to);
+ server.getPluginManager().callEvent(event);
+ }
// CraftBukkit end
List list = this.world.b((Entity) this, this.boundingBox.b(0.20000000298023224D, 0.0D, 0.20000000298023224D));