Modified Inventory saving in game

Saves the inventory contents instead of the inventory
This commit is contained in:
WhiteFoxHD 2018-07-09 16:01:47 -04:00 committed by GitHub
parent 607c443254
commit c65f908a1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 10 deletions

View File

@ -261,22 +261,20 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
return inventory; return inventory;
} else { } else {
//long startTime = System.nanoTime(); //long startTime = System.nanoTime();
Inventory contents = StringToInventory(chestSerialized); ItemStack[] contents = new ItemStack[0];
inventory.setContents(contents.getContents()); try {
// long endTime = System.nanoTime(); contents = StringToInventory(chestSerialized);
// long duration = (endTime - startTime); } catch (IOException e) {
// Bukkit.broadcastMessage("chest deserialization time: " + duration + " nano seconds"); e.printStackTrace();
}
inventory.setContents(contents);
return inventory; return inventory;
} }
} }
@Override @Override
public void setChest(Inventory inventory) { public void setChest(Inventory inventory) {
// long startTime = System.nanoTime(); chestSerialized = InventoryToString(inventory.getContents());
chestSerialized = InventoryToString(inventory);
// long endTime = System.nanoTime();
// long duration = (endTime - startTime);
// Bukkit.broadcastMessage("chest serialization time: " + duration + " nano seconds");
} }