From 02a5d09ddf030d299f9ad9298b02fdee0821957c Mon Sep 17 00:00:00 2001 From: Black-Hole Date: Sat, 23 Mar 2013 16:10:14 +0100 Subject: [PATCH] Call EntityChangeBlockEvent when boats destroy blocks. Fixes BUKKIT-3871 --- src/main/java/net/minecraft/server/EntityBoat.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/net/minecraft/server/EntityBoat.java b/src/main/java/net/minecraft/server/EntityBoat.java index 4aa3d5900c..8839a452ac 100644 --- a/src/main/java/net/minecraft/server/EntityBoat.java +++ b/src/main/java/net/minecraft/server/EntityBoat.java @@ -4,6 +4,7 @@ import java.util.List; // CraftBukkit start import org.bukkit.Location; +import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.entity.Vehicle; import org.bukkit.event.vehicle.VehicleDamageEvent; import org.bukkit.event.vehicle.VehicleDestroyEvent; @@ -379,8 +380,20 @@ public class EntityBoat extends Entity { int i2 = this.world.getTypeId(i1, l1, j1); if (i2 == Block.SNOW.id) { + // CraftBukkit start + if (CraftEventFactory.callEntityChangeBlockEvent(this, i1, l1, j1, 0, 0).isCancelled()) { + continue; + } + // CraftBukkit end + this.world.setAir(i1, l1, j1); } else if (i2 == Block.WATER_LILY.id) { + // CraftBukkit start + if (CraftEventFactory.callEntityChangeBlockEvent(this, i1, l1, j1, 0, 0).isCancelled()) { + continue; + } + // CraftBukkit end + this.world.setAir(i1, l1, j1, true); } }