Stop using our own deprecated method on shutdown. Attempt to force close player's vault if they have it open while the server is shutting down. Should resolve #338
This commit is contained in:
@@ -126,8 +126,10 @@ public class PlayerVaults extends JavaPlugin {
|
|||||||
Inventory inventory = player.getOpenInventory().getTopInventory();
|
Inventory inventory = player.getOpenInventory().getTopInventory();
|
||||||
if (inventory.getViewers().size() == 1) {
|
if (inventory.getViewers().size() == 1) {
|
||||||
VaultViewInfo info = this.inVault.get(player.getUniqueId().toString());
|
VaultViewInfo info = this.inVault.get(player.getUniqueId().toString());
|
||||||
UUIDVaultManager.getInstance().saveVault(inventory, player.getUniqueId().toString(), info.getNumber());
|
VaultManager.getInstance().saveVault(inventory, player.getUniqueId(), info.getNumber());
|
||||||
this.openInventories.remove(info.toString());
|
this.openInventories.remove(info.toString());
|
||||||
|
// try this to make sure that they can't make further edits if the process hangs.
|
||||||
|
player.closeInventory();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.inVault.remove(player.getUniqueId().toString());
|
this.inVault.remove(player.getUniqueId().toString());
|
||||||
|
|||||||
Reference in New Issue
Block a user