Save before writing

This commit is contained in:
raoulvdberge
2017-05-11 23:46:09 +02:00
parent 4e3a00f474
commit dfedd69443
2 changed files with 5 additions and 1 deletions

View File

@@ -314,7 +314,7 @@ public class PortableGrid implements IGrid, IPortableGrid {
@Override
public void onClosed(EntityPlayer player) {
if (!player.world.isRemote && storage != null) {
if (!player.getEntityWorld().isRemote && storage != null) {
storage.writeToNBT();
RSUtils.writeItems(disk, 4, stack.getTagCompound());

View File

@@ -380,6 +380,10 @@ public class TilePortableGrid extends TileBase implements IGrid, IPortableGrid {
public NBTTagCompound write(NBTTagCompound tag) {
super.write(tag);
if (storage != null) {
storage.writeToNBT();
}
tag.setInteger(NetworkNodeGrid.NBT_SORTING_DIRECTION, sortingDirection);
tag.setInteger(NetworkNodeGrid.NBT_SORTING_TYPE, sortingType);
tag.setInteger(NetworkNodeGrid.NBT_SEARCH_BOX_MODE, searchBoxMode);