mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 08:56:23 +01:00
SPIGOT-4212: EntityInteractEvent when an entity tries to interact with a door
This commit is contained in:
parent
2f17f677aa
commit
7dc4738528
1 changed files with 17 additions and 0 deletions
17
nms-patches/PathfinderGoalDoorInteract.patch
Normal file
17
nms-patches/PathfinderGoalDoorInteract.patch
Normal file
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue