0.7 should now work
This commit is contained in:
@@ -16,7 +16,10 @@ import refinedstorage.RefinedStorage;
|
|||||||
import refinedstorage.RefinedStorageUtils;
|
import refinedstorage.RefinedStorageUtils;
|
||||||
import refinedstorage.network.MessageTileContainerUpdate;
|
import refinedstorage.network.MessageTileContainerUpdate;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
public abstract class TileBase extends TileEntity implements ITickable {
|
public abstract class TileBase extends TileEntity implements ITickable {
|
||||||
|
public static final String NBT_UPDATE = "U";
|
||||||
public static final String NBT_DIRECTION = "Direction";
|
public static final String NBT_DIRECTION = "Direction";
|
||||||
|
|
||||||
private EnumFacing direction = EnumFacing.NORTH;
|
private EnumFacing direction = EnumFacing.NORTH;
|
||||||
@@ -55,7 +58,7 @@ public abstract class TileBase extends TileEntity implements ITickable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public NBTTagCompound writeUpdate(NBTTagCompound tag) {
|
public NBTTagCompound writeUpdate(NBTTagCompound tag) {
|
||||||
tag.setByte("U", (byte) 1);
|
tag.setByte(NBT_UPDATE, (byte) 1);
|
||||||
tag.setInteger(NBT_DIRECTION, direction.ordinal());
|
tag.setInteger(NBT_DIRECTION, direction.ordinal());
|
||||||
|
|
||||||
return tag;
|
return tag;
|
||||||
@@ -72,13 +75,13 @@ public abstract class TileBase extends TileEntity implements ITickable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readFromNBT(NBTTagCompound nbt) {
|
public void readFromNBT(NBTTagCompound tag) {
|
||||||
super.readFromNBT(nbt);
|
super.readFromNBT(tag);
|
||||||
|
|
||||||
if (nbt.hasKey("U")) {
|
if (tag.hasKey(NBT_UPDATE)) {
|
||||||
readUpdate(nbt);
|
readUpdate(tag);
|
||||||
} else {
|
} else {
|
||||||
read(nbt);
|
read(tag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,6 +95,12 @@ public abstract class TileBase extends TileEntity implements ITickable {
|
|||||||
return writeUpdate(super.getUpdateTag());
|
return writeUpdate(super.getUpdateTag());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public SPacketUpdateTileEntity getUpdatePacket() {
|
||||||
|
return new SPacketUpdateTileEntity(pos, 1, getUpdateTag());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) {
|
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) {
|
||||||
readUpdate(packet.getNbtCompound());
|
readUpdate(packet.getNbtCompound());
|
||||||
|
|||||||
Reference in New Issue
Block a user