diff options
author | Brokkonaut <hannos17@gmx.de> | 2014-03-29 22:39:17 +0100 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2014-04-18 12:25:41 -0500 |
commit | a86bc7aeb394df65521555f1b73357c68503cbc5 (patch) | |
tree | 8581c0b9f43dfde57fb70e487cab02651c13429b /src/main/java | |
parent | 0092460086aaa09879ac33195b32229dc9476eb0 (diff) | |
download | craftbukkit-a86bc7aeb394df65521555f1b73357c68503cbc5.tar craftbukkit-a86bc7aeb394df65521555f1b73357c68503cbc5.tar.gz craftbukkit-a86bc7aeb394df65521555f1b73357c68503cbc5.tar.lz craftbukkit-a86bc7aeb394df65521555f1b73357c68503cbc5.tar.xz craftbukkit-a86bc7aeb394df65521555f1b73357c68503cbc5.zip |
Call event when boat is destroyed by falling. Fixes BUKKIT-5500
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityBoat.java | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/main/java/net/minecraft/server/EntityBoat.java b/src/main/java/net/minecraft/server/EntityBoat.java index 0df3b6bb..82503958 100644 --- a/src/main/java/net/minecraft/server/EntityBoat.java +++ b/src/main/java/net/minecraft/server/EntityBoat.java @@ -445,17 +445,24 @@ public class EntityBoat extends Entity { if (this.fallDistance > 3.0F) { this.b(this.fallDistance); if (!this.world.isStatic && !this.dead) { - this.die(); + // CraftBukkit start + Vehicle vehicle = (Vehicle) this.getBukkitEntity(); + VehicleDestroyEvent destroyEvent = new VehicleDestroyEvent(vehicle, null); + this.world.getServer().getPluginManager().callEvent(destroyEvent); + if (!destroyEvent.isCancelled()) { + this.die(); - int l; + int l; - for (l = 0; l < 3; ++l) { - this.a(Item.getItemOf(Blocks.WOOD), 1, 0.0F); - } + for (l = 0; l < 3; ++l) { + this.a(Item.getItemOf(Blocks.WOOD), 1, 0.0F); + } - for (l = 0; l < 2; ++l) { - this.a(Items.STICK, 1, 0.0F); + for (l = 0; l < 2; ++l) { + this.a(Items.STICK, 1, 0.0F); + } } + // CraftBukkit end } this.fallDistance = 0.0F; |