summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Wolf <nathan@elmakers.com>2018-08-02 16:18:11 -0700
committermd_5 <git@md-5.net>2018-08-03 09:50:32 +1000
commit7dc47385287c1f8e946d1b954a0a54dc84361bd9 (patch)
tree9bb395dd4101b653132130a4b497b136bade04df
parent2f17f677aae3db7e10ee61a676aa9aee01c30ecb (diff)
downloadcraftbukkit-7dc47385287c1f8e946d1b954a0a54dc84361bd9.tar
craftbukkit-7dc47385287c1f8e946d1b954a0a54dc84361bd9.tar.gz
craftbukkit-7dc47385287c1f8e946d1b954a0a54dc84361bd9.tar.lz
craftbukkit-7dc47385287c1f8e946d1b954a0a54dc84361bd9.tar.xz
craftbukkit-7dc47385287c1f8e946d1b954a0a54dc84361bd9.zip
SPIGOT-4212: EntityInteractEvent when an entity tries to interact with a door
-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);
+ }
+ }