summaryrefslogtreecommitdiffstats
path: root/nms-patches
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches')
-rw-r--r--nms-patches/PathfinderGoalDoorInteract.patch17
1 files changed, 17 insertions, 0 deletions
diff --git a/nms-patches/PathfinderGoalDoorInteract.patch b/nms-patches/PathfinderGoalDoorInteract.patch
new file mode 100644
index 00000000..2b2ba9dd
--- /dev/null
+++ b/nms-patches/PathfinderGoalDoorInteract.patch
@@ -0,0 +1,17 @@
+--- a/net/minecraft/server/PathfinderGoalDoorInteract.java
++++ b/net/minecraft/server/PathfinderGoalDoorInteract.java
+@@ -37,6 +37,14 @@
+ IBlockData iblockdata = this.a.world.getType(this.b);
+
+ if (iblockdata.getBlock() instanceof BlockDoor) {
++ // CraftBukkit start - entities opening doors
++ org.bukkit.event.entity.EntityInteractEvent event = new org.bukkit.event.entity.EntityInteractEvent(this.a.getBukkitEntity(), this.a.world.getWorld().getBlockAt(this.b.getX(), this.b.getY(), this.b.getZ()));
++ this.a.world.getServer().getPluginManager().callEvent(event);
++ if (event.isCancelled()) {
++ return;
++ }
++ // CaftBukkit end
++
+ ((BlockDoor) iblockdata.getBlock()).setDoor(this.a.world, this.b, flag);
+ }
+ }