mirror of
https://github.com/GTNewHorizons/Mantle.git
synced 2026-11-19 03:39:18 +00:00
Save inventory size for Tiles with inventory, since we also allow resizing now
This commit is contained in:
1 parent
767db35566
commit
b07c30ef31
1 file changed
+6
@@ -179,6 +179,9 @@ public class TileInventory extends TileEntity implements IInventory {
|
||||
|
||||
public void readInventoryFromNBT(NBTTagCompound tags) {
|
||||
super.readFromNBT(tags);
|
||||
|
||||
this.resize(tags.getInteger("InventorySize"));
|
||||
|
||||
readInventoryFromNBT(this, tags);
|
||||
|
||||
if(tags.hasKey("CustomName", 8)) {
|
||||
@@ -189,6 +192,9 @@ public class TileInventory extends TileEntity implements IInventory {
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound tags) {
|
||||
super.writeToNBT(tags);
|
||||
|
||||
tags.setInteger("InventorySize", inventory.length);
|
||||
|
||||
writeInventoryToNBT(this, tags);
|
||||
|
||||
if(this.hasCustomName()) {
|
||||
|
||||
Reference in new issue
Block a user