33
paper-server/nms-patches/BehaviorInteractDoor.patch
Normal file
33
paper-server/nms-patches/BehaviorInteractDoor.patch
Normal file
@@ -0,0 +1,33 @@
|
||||
--- a/net/minecraft/server/BehaviorInteractDoor.java
|
||||
+++ b/net/minecraft/server/BehaviorInteractDoor.java
|
||||
@@ -27,7 +27,7 @@
|
||||
Set<BlockPosition> 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<BlockPosition> a(WorldServer worldserver, List<GlobalPos> list, List<BlockPosition> list1) {
|
||||
@@ -39,13 +39,20 @@
|
||||
return (Set) stream.filter(list1::contains).collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
- private void a(WorldServer worldserver, List<BlockPosition> list, Set<BlockPosition> set, int i) {
|
||||
+ private void a(WorldServer worldserver, List<BlockPosition> list, Set<BlockPosition> 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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user