summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2014-08-14 01:58:17 +0100
committerKHobbits <rob@khobbits.co.uk>2014-08-14 01:58:17 +0100
commit5125a137f4ab39cf6870c9baed67a301e3b9d4f7 (patch)
tree8fdbb397a4e63b12e5f67fa6be3b1c12a43db0c6
parent3f1c996959930d01ccfb6146d63ba2caddf2da62 (diff)
downloadEssentials-5125a137f4ab39cf6870c9baed67a301e3b9d4f7.tar
Essentials-5125a137f4ab39cf6870c9baed67a301e3b9d4f7.tar.gz
Essentials-5125a137f4ab39cf6870c9baed67a301e3b9d4f7.tar.lz
Essentials-5125a137f4ab39cf6870c9baed67a301e3b9d4f7.tar.xz
Essentials-5125a137f4ab39cf6870c9baed67a301e3b9d4f7.zip
Make sure we close any open inventories of players who leave.
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
index f11182271..4ca588e6e 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
@@ -177,6 +177,19 @@ public class EssentialsPlayerListener implements Listener
{
user.getBase().getOpenInventory().getTopInventory().clear();
}
+
+ for (HumanEntity viewer : user.getBase().getInventory().getViewers())
+ {
+ if (viewer instanceof Player)
+ {
+ User uviewer = ess.getUser((Player)viewer);
+ if (uviewer.isInvSee())
+ {
+ uviewer.getBase().closeInventory();
+ }
+ }
+ }
+
user.updateActivity(false);
user.dispose();
}