Ensure backpack gets saved before beeing unloaded

This commit is contained in:
GeorgH93 2023-06-01 21:02:06 +02:00
parent 084e5a475b
commit 239b8d0ec4
No known key found for this signature in database
GPG Key ID: D1630D37F9E4B3C8
3 changed files with 1 additions and 2 deletions

View File

@ -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());
}

View File

@ -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);
}
}

View File

@ -53,7 +53,6 @@ public void run()
{
if(!backpack.isOpen())
{
backpack.save();
cache.unloadBackpack(backpack);
}
else