Save before writing
This commit is contained in:
@@ -314,7 +314,7 @@ public class PortableGrid implements IGrid, IPortableGrid {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClosed(EntityPlayer player) {
|
public void onClosed(EntityPlayer player) {
|
||||||
if (!player.world.isRemote && storage != null) {
|
if (!player.getEntityWorld().isRemote && storage != null) {
|
||||||
storage.writeToNBT();
|
storage.writeToNBT();
|
||||||
|
|
||||||
RSUtils.writeItems(disk, 4, stack.getTagCompound());
|
RSUtils.writeItems(disk, 4, stack.getTagCompound());
|
||||||
|
|||||||
@@ -380,6 +380,10 @@ public class TilePortableGrid extends TileBase implements IGrid, IPortableGrid {
|
|||||||
public NBTTagCompound write(NBTTagCompound tag) {
|
public NBTTagCompound write(NBTTagCompound tag) {
|
||||||
super.write(tag);
|
super.write(tag);
|
||||||
|
|
||||||
|
if (storage != null) {
|
||||||
|
storage.writeToNBT();
|
||||||
|
}
|
||||||
|
|
||||||
tag.setInteger(NetworkNodeGrid.NBT_SORTING_DIRECTION, sortingDirection);
|
tag.setInteger(NetworkNodeGrid.NBT_SORTING_DIRECTION, sortingDirection);
|
||||||
tag.setInteger(NetworkNodeGrid.NBT_SORTING_TYPE, sortingType);
|
tag.setInteger(NetworkNodeGrid.NBT_SORTING_TYPE, sortingType);
|
||||||
tag.setInteger(NetworkNodeGrid.NBT_SEARCH_BOX_MODE, searchBoxMode);
|
tag.setInteger(NetworkNodeGrid.NBT_SEARCH_BOX_MODE, searchBoxMode);
|
||||||
|
|||||||
Reference in New Issue
Block a user