From 695f25a32b5e5ace3533b8fd6b6c2a4b8415fdb0 Mon Sep 17 00:00:00 2001 From: sk89q Date: Thu, 13 Oct 2011 01:16:22 -0700 Subject: [PATCH] Added a case previously not covered by VehicleDestroyEvent for boats. --- src/main/java/net/minecraft/server/EntityBoat.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/net/minecraft/server/EntityBoat.java b/src/main/java/net/minecraft/server/EntityBoat.java index a2d94b74e1..d959ed36b1 100644 --- a/src/main/java/net/minecraft/server/EntityBoat.java +++ b/src/main/java/net/minecraft/server/EntityBoat.java @@ -303,6 +303,13 @@ public class EntityBoat extends Entity { if (this.positionChanged && d4 > 0.15D) { if (!this.world.isStatic) { + // CraftBukkit start + Vehicle vehicle = (Vehicle) this.getBukkitEntity(); + VehicleDestroyEvent destroyEvent = new VehicleDestroyEvent(vehicle, null); + this.world.getServer().getPluginManager().callEvent(destroyEvent); + + if (!destroyEvent.isCancelled()) { + // CraftBukkit end this.die(); int k; @@ -314,6 +321,7 @@ public class EntityBoat extends Entity { for (k = 0; k < 2; ++k) { this.a(Item.STICK.id, 1, 0.0F); } + }// CraftBukkit } } else { this.motX *= 0.9900000095367432D;