Update vault size each time inventory is opened.

Before, the VaultViewInfo was being stored as name instead of uuid as well as not being removed when a vault was closed. This caused the same inventory to be accessed from memory each time the vault was opened after the first opening since the last restart when it would load from file. Since we are recreating the inventory each time, there will likely be a performance loss but we will update the vault title and size each time its opened. Resolves #58.
This commit is contained in:
drtshock
2015-04-27 14:02:51 -05:00
parent 8375d71e3e
commit ede738019a
8 changed files with 59 additions and 292 deletions
@@ -81,9 +81,9 @@ public class Serialization {
return result;
}
public static Inventory toInventory(List<String> stringItems, int number, int size) {
public static Inventory toInventory(List<String> stringItems, int number, int size, String title) {
VaultHolder holder = new VaultHolder(number);
Inventory inv = Bukkit.createInventory(holder, size, ChatColor.RED + "Vault #" + number);
Inventory inv = Bukkit.createInventory(holder, size, title);
holder.setInventory(inv);
List<ItemStack> contents = new ArrayList<>();
for (String piece : stringItems) {