mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2024-11-14 10:45:23 +01:00
Ensure backpack gets saved before beeing unloaded
This commit is contained in:
parent
084e5a475b
commit
239b8d0ec4
@ -240,6 +240,7 @@ public void getBackpack(final OfflinePlayer player, final Callback<at.pcgamingfr
|
||||
|
||||
public void unloadBackpack(Backpack backpack)
|
||||
{
|
||||
backpack.save();
|
||||
backpacks.remove(backpack.getOwner());
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,6 @@ public void playerLeaveEvent(PlayerQuitEvent event)
|
||||
Backpack backpack = cache.getBackpack(event.getPlayer());
|
||||
if(backpack != null && !backpack.isOpen())
|
||||
{
|
||||
backpack.save();
|
||||
cache.unloadBackpack(backpack);
|
||||
}
|
||||
}
|
||||
|
@ -53,7 +53,6 @@ public void run()
|
||||
{
|
||||
if(!backpack.isOpen())
|
||||
{
|
||||
backpack.save();
|
||||
cache.unloadBackpack(backpack);
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user