From 39b7d8263330a0c6156bd61d232d6ace805494fa Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Thu, 2 Aug 2018 16:18:11 -0700 Subject: [PATCH] SPIGOT-4212: EntityInteractEvent when an entity tries to interact with a door By: Nathan Wolf --- .../PathfinderGoalDoorInteract.patch | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 paper-server/nms-patches/PathfinderGoalDoorInteract.patch diff --git a/paper-server/nms-patches/PathfinderGoalDoorInteract.patch b/paper-server/nms-patches/PathfinderGoalDoorInteract.patch new file mode 100644 index 0000000000..2b2ba9dde6 --- /dev/null +++ b/paper-server/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); + } + }