Prevent users from opening a vault if they already have one open.

This commit is contained in:
drtshock
2014-03-12 13:57:23 -05:00
parent 4c3da6e8f5
commit 1342a5584e
2 changed files with 1 additions and 2 deletions
@@ -34,6 +34,7 @@ public class Commands implements CommandExecutor {
if (cmd.getName().equalsIgnoreCase("pv")) {
if (sender instanceof Player) {
Player p = (Player) sender;
if(PlayerVaults.IN_VAULT.containsKey(p.getName())) return true; // don't let them open another vault.
switch (args.length) {
case 1:
if (VaultOperations.openOwnVault(p, args[0])) {
@@ -55,8 +55,6 @@ public class Listeners implements Listener {
public void saveVault(Player player) {
if (PlayerVaults.IN_VAULT.containsKey(player.getName())) {
Inventory inv = player.getOpenInventory().getTopInventory();
if(inv.getViewers().contains(player))
player.closeInventory();
if (inv.getViewers().size() == 1) {
VaultViewInfo info = PlayerVaults.IN_VAULT.get(player.getName());
try {