summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBlack-Hole <black-hole@live.com>2013-03-23 16:10:14 +0100
committerGJ <gjmcferrin@gmail.com>2013-03-25 16:55:48 -0400
commit02a5d09ddf030d299f9ad9298b02fdee0821957c (patch)
treeba33de65288b267273a42b576ff2f2a52bf5cc09
parent18d7bc7ca3ff8fa5a183b9bb6bbab8ae388a8835 (diff)
downloadcraftbukkit-02a5d09ddf030d299f9ad9298b02fdee0821957c.tar
craftbukkit-02a5d09ddf030d299f9ad9298b02fdee0821957c.tar.gz
craftbukkit-02a5d09ddf030d299f9ad9298b02fdee0821957c.tar.lz
craftbukkit-02a5d09ddf030d299f9ad9298b02fdee0821957c.tar.xz
craftbukkit-02a5d09ddf030d299f9ad9298b02fdee0821957c.zip
Call EntityChangeBlockEvent when boats destroy blocks. Fixes BUKKIT-3871
-rw-r--r--src/main/java/net/minecraft/server/EntityBoat.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/EntityBoat.java b/src/main/java/net/minecraft/server/EntityBoat.java
index 4aa3d590..8839a452 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);
}
}