summaryrefslogtreecommitdiffstats
path: root/nms-patches/PathfinderGoalBreakDoor.patch
blob: a623a70e3b507e2d3baf21ca4ad7102967c70a03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
--- ../work/decompile-8eb82bde//net/minecraft/server/PathfinderGoalBreakDoor.java	2014-11-28 11:22:56.098823159 +0000
+++ src/main/java/net/minecraft/server/PathfinderGoalBreakDoor.java	2014-11-28 11:01:54.000000000 +0000
@@ -63,6 +63,12 @@
         }
 
         if (this.g == 240 && this.a.world.getDifficulty() == EnumDifficulty.HARD) {
+            // CraftBukkit start
+            if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityBreakDoorEvent(this.a, this.b.getX(), this.b.getY(), this.b.getZ()).isCancelled()) {
+                this.c();
+                return;
+            }
+            // CraftBukkit end
             this.a.world.setAir(this.b);
             this.a.world.triggerEffect(1012, this.b, 0);
             this.a.world.triggerEffect(2001, this.b, Block.getId(this.c));