This commit is contained in:
gomeow
2013-08-25 14:51:44 -07:00
parent ce91614d0f
commit f484a8eb71
@@ -79,8 +79,18 @@ public class PlayerVaults extends JavaPlugin {
public void onDisable() {
for (Player p : Bukkit.getOnlinePlayers()) {
if (IN_VAULT.containsKey(p.getName())) {
p.closeInventory();
Inventory inv = p.getOpenInventory().getTopInventory();
if (inv.getViewers().size() == 1) {
VaultViewInfo info = PlayerVaults.IN_VAULT.get(p.getName());
try {
VM.saveVault(inv, info.getHolder(), info.getNumber());
} catch (IOException e) {
}
PlayerVaults.OPENINVENTORIES.remove(info.toString());
}
PlayerVaults.IN_VAULT.remove(p.getName());
}
p.closeInventory();
}
}
@@ -222,6 +232,7 @@ public class PlayerVaults extends JavaPlugin {
/**
* Set an object in the config.yml
*
* @param path The path in the config.
* @param object What to be saved.
* @param conf Where to save the object.
@@ -296,6 +307,7 @@ public class PlayerVaults extends JavaPlugin {
/**
* Gets the lang.yml config.
*
* @return The lang.yml config.
*/
public YamlConfiguration getLang() {
@@ -304,6 +316,7 @@ public class PlayerVaults extends JavaPlugin {
/**
* Get the lang.yml file.
*
* @return The lang.yml file.
*/
public File getLangFile() {