mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-23 09:37:50 +01:00
Make sure we close any open inventories of players who leave.
This commit is contained in:
parent
3f1c996959
commit
5125a137f4
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user