--- a/net/minecraft/server/BehaviorInteractDoor.java +++ b/net/minecraft/server/BehaviorInteractDoor.java @@ -23,7 +23,7 @@ Set set = this.a(worldserver, list, list1); int j = pathentity.f() - 1; - this.a(worldserver, list1, set, j); + this.a(worldserver, list1, set, j, entityliving); // CraftBukkit - add entity } private Set a(WorldServer worldserver, List list, List list1) { @@ -35,13 +35,20 @@ return (Set) stream.filter(list1::contains).collect(Collectors.toSet()); } - private void a(WorldServer worldserver, List list, Set set, int i) { + private void a(WorldServer worldserver, List list, Set set, int i, EntityLiving entityliving) { // CraftBukkit - add entity set.forEach((blockposition) -> { int j = list.indexOf(blockposition); IBlockData iblockdata = worldserver.getType(blockposition); Block block = iblockdata.getBlock(); if (TagsBlock.WOODEN_DOORS.isTagged(block) && block instanceof BlockDoor) { + // CraftBukkit start - entities opening doors + org.bukkit.event.entity.EntityInteractEvent event = new org.bukkit.event.entity.EntityInteractEvent(entityliving.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(entityliving.world, blockposition)); + entityliving.world.getServer().getPluginManager().callEvent(event); + if (event.isCancelled()) { + return; + } + // CaftBukkit end ((BlockDoor) block).setDoor(worldserver, blockposition, j >= i); }