Call event when boat is destroyed by falling. Fixes BUKKIT-5500

Dieser Commit ist enthalten in:
Brokkonaut 2014-03-29 22:39:17 +01:00 committet von Travis Watkins
Ursprung 0092460086
Commit a86bc7aeb3

Datei anzeigen

@ -445,6 +445,11 @@ public class EntityBoat extends Entity {
if (this.fallDistance > 3.0F) {
this.b(this.fallDistance);
if (!this.world.isStatic && !this.dead) {
// 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;
@ -457,6 +462,8 @@ public class EntityBoat extends Entity {
this.a(Items.STICK, 1, 0.0F);
}
}
// CraftBukkit end
}
this.fallDistance = 0.0F;
}