2013-03-23 06:56:28 +00:00
|
|
|
From d07d3b2724a125ba3208286bccacc3f35d5b172c Mon Sep 17 00:00:00 2001
|
2013-01-15 01:18:40 +00:00
|
|
|
From: md_5 <md_5@bigpond.com>
|
|
|
|
Date: Sun, 23 Dec 2012 17:09:40 +1100
|
2013-01-19 08:22:25 +00:00
|
|
|
Subject: [PATCH] Address BUKKIT-3286 by firing the inventory close event when
|
|
|
|
a secondary container is closed due to the player entity being destroyed.
|
|
|
|
This covers all edge cases such as server stop / player kick / player quit.
|
2013-01-15 01:18:40 +00:00
|
|
|
|
|
|
|
---
|
|
|
|
src/main/java/net/minecraft/server/EntityHuman.java | 6 ++++++
|
|
|
|
1 file changed, 6 insertions(+)
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
|
2013-03-20 21:54:12 +00:00
|
|
|
index 1f7b8ad..6f77702 100644
|
2013-01-15 01:18:40 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityHuman.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
|
2013-03-15 21:35:56 +00:00
|
|
|
@@ -5,11 +5,13 @@ import java.util.Iterator;
|
2013-01-15 01:18:40 +00:00
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
// CraftBukkit start
|
|
|
|
+import org.bukkit.Bukkit;
|
2013-01-20 03:52:20 +00:00
|
|
|
import org.bukkit.craftbukkit.entity.CraftHumanEntity;
|
2013-01-15 01:18:40 +00:00
|
|
|
import org.bukkit.craftbukkit.entity.CraftItem;
|
2013-03-02 22:37:31 +00:00
|
|
|
import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
2013-01-15 01:18:40 +00:00
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
import org.bukkit.event.entity.EntityCombustByEntityEvent;
|
|
|
|
+import org.bukkit.event.inventory.InventoryCloseEvent;
|
|
|
|
import org.bukkit.event.player.PlayerBedEnterEvent;
|
|
|
|
import org.bukkit.event.player.PlayerBedLeaveEvent;
|
|
|
|
import org.bukkit.event.player.PlayerDropItemEvent;
|
2013-03-15 21:35:56 +00:00
|
|
|
@@ -941,6 +943,10 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
|
2013-01-15 01:18:40 +00:00
|
|
|
super.die();
|
|
|
|
this.defaultContainer.b(this);
|
|
|
|
if (this.activeContainer != null) {
|
|
|
|
+ // CraftBukkit start
|
|
|
|
+ InventoryCloseEvent event = new InventoryCloseEvent(this.activeContainer.getBukkitView());
|
|
|
|
+ Bukkit.getServer().getPluginManager().callEvent(event);
|
|
|
|
+ // CraftBukkit end
|
|
|
|
this.activeContainer.b(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--
|
2013-03-22 22:31:28 +00:00
|
|
|
1.8.1-rc2
|
2013-01-15 01:18:40 +00:00
|
|
|
|