Modified Inventory saving in game
Saves the inventory contents instead of the inventory
This commit is contained in:
parent
607c443254
commit
c65f908a1b
@ -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");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user