mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +01:00
[Bleeding] Added EntityBreakDoorEvent. Fixes BUKKIT-1134
By: feildmaster <admin@feildmaster.com>
This commit is contained in:
parent
9421839d6d
commit
cad4f85021
1 changed files with 10 additions and 0 deletions
|
@ -441,6 +441,16 @@ public class CraftEventFactory {
|
|||
return event;
|
||||
}
|
||||
|
||||
public static EntityBreakDoorEvent callEntityBreakDoorEvent(Entity entity, int x, int y, int z) {
|
||||
org.bukkit.entity.Entity entity1 = entity.getBukkitEntity();
|
||||
Block block = entity1.getWorld().getBlockAt(x, y, z);
|
||||
|
||||
EntityBreakDoorEvent event = new EntityBreakDoorEvent((LivingEntity) entity1, block);
|
||||
entity1.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
return event;
|
||||
}
|
||||
|
||||
public static Container callInventoryOpenEvent(EntityPlayer player, Container container) {
|
||||
if (player.activeContainer != player.defaultContainer) { // fire INVENTORY_CLOSE if one already open
|
||||
player.netServerHandler.handleContainerClose(new Packet101CloseWindow(player.activeContainer.windowId));
|
||||
|
|
Loading…
Reference in a new issue