diff options
author | md_5 <md_5@bigpond.com> | 2012-08-03 17:18:48 +1000 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2012-08-03 02:41:48 -0500 |
commit | 07794300d0320f412333ffe51b26d8bcafd3e2f1 (patch) | |
tree | a822b75f4276ab94c1e2835a6d182cdb44c815bf /src | |
parent | fe8fc6b90e9e16b62f8123f9309561b9262f9849 (diff) | |
download | craftbukkit-07794300d0320f412333ffe51b26d8bcafd3e2f1.tar craftbukkit-07794300d0320f412333ffe51b26d8bcafd3e2f1.tar.gz craftbukkit-07794300d0320f412333ffe51b26d8bcafd3e2f1.tar.lz craftbukkit-07794300d0320f412333ffe51b26d8bcafd3e2f1.tar.xz craftbukkit-07794300d0320f412333ffe51b26d8bcafd3e2f1.zip |
[Bleeding] Fire inventory close event. Fixes BUKKIT-2036
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/net/minecraft/server/NetServerHandler.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java index b6d1f298..aa43435e 100644 --- a/src/main/java/net/minecraft/server/NetServerHandler.java +++ b/src/main/java/net/minecraft/server/NetServerHandler.java @@ -1044,6 +1044,14 @@ public class NetServerHandler extends NetHandler { public void a(Packet9Respawn packet9respawn) {} public void handleContainerClose(Packet101CloseWindow packet101closewindow) { + if (this.player.dead) return; // CraftBukkit + + // CraftBukkit start - INVENTORY_CLOSE hook + InventoryCloseEvent event = new InventoryCloseEvent(this.player.activeContainer.getBukkitView()); + server.getPluginManager().callEvent(event); + this.player.activeContainer.transferTo(this.player.defaultContainer, getPlayer()); + // CraftBukkit end + this.player.l(); } |