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;
} else {
//long startTime = System.nanoTime();
Inventory contents = StringToInventory(chestSerialized);
inventory.setContents(contents.getContents());
// long endTime = System.nanoTime();
// long duration = (endTime - startTime);
// Bukkit.broadcastMessage("chest deserialization time: " + duration + " nano seconds");
ItemStack[] contents = new ItemStack[0];
try {
contents = StringToInventory(chestSerialized);
} catch (IOException e) {
e.printStackTrace();
}
inventory.setContents(contents);
return inventory;
}
}
@Override
public void setChest(Inventory inventory) {
// long startTime = System.nanoTime();
chestSerialized = InventoryToString(inventory);
// long endTime = System.nanoTime();
// long duration = (endTime - startTime);
// Bukkit.broadcastMessage("chest serialization time: " + duration + " nano seconds");
chestSerialized = InventoryToString(inventory.getContents());
}