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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user