Paper/nms-patches/PathfinderGoalDoorInteract.patch

18 lines
881 B
Diff
Raw Normal View History

--- 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);
}
}