Make sure we close any open inventories of players who leave.

This commit is contained in:
KHobbits 2014-08-14 01:58:17 +01:00
parent 3f1c996959
commit 5125a137f4

View File

@ -177,6 +177,19 @@ public class EssentialsPlayerListener implements Listener
{ {
user.getBase().getOpenInventory().getTopInventory().clear(); 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.updateActivity(false);
user.dispose(); user.dispose();
} }