Fixes #72
This commit is contained in:
@@ -19,7 +19,6 @@ import refinedstorage.network.MessageTileContainerUpdate;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public abstract class TileBase extends TileEntity implements ITickable {
|
||||
public static final String NBT_UPDATE = "U";
|
||||
public static final String NBT_DIRECTION = "Direction";
|
||||
|
||||
private EnumFacing direction = EnumFacing.NORTH;
|
||||
@@ -58,7 +57,6 @@ public abstract class TileBase extends TileEntity implements ITickable {
|
||||
}
|
||||
|
||||
public NBTTagCompound writeUpdate(NBTTagCompound tag) {
|
||||
tag.setByte(NBT_UPDATE, (byte) 1);
|
||||
tag.setInteger(NBT_DIRECTION, direction.ordinal());
|
||||
|
||||
return tag;
|
||||
@@ -74,22 +72,6 @@ public abstract class TileBase extends TileEntity implements ITickable {
|
||||
RefinedStorageUtils.updateBlock(worldObj, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tag) {
|
||||
super.readFromNBT(tag);
|
||||
|
||||
if (tag.hasKey(NBT_UPDATE)) {
|
||||
readUpdate(tag);
|
||||
} else {
|
||||
read(tag);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound tag) {
|
||||
return write(super.writeToNBT(tag));
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getUpdateTag() {
|
||||
return writeUpdate(super.getUpdateTag());
|
||||
@@ -106,6 +88,25 @@ public abstract class TileBase extends TileEntity implements ITickable {
|
||||
readUpdate(packet.getNbtCompound());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleUpdateTag(NBTTagCompound tag) {
|
||||
super.readFromNBT(tag);
|
||||
|
||||
readUpdate(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tag) {
|
||||
super.readFromNBT(tag);
|
||||
|
||||
read(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound tag) {
|
||||
return write(super.writeToNBT(tag));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newState) {
|
||||
return oldState.getBlock() != newState.getBlock();
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Reference in New Issue
Block a user