This should fix things
This commit is contained in:
@@ -26,7 +26,7 @@ public class RefinedStorageUtils {
|
||||
public static final int COMPARE_NBT = 2;
|
||||
public static final int COMPARE_QUANTITY = 4;
|
||||
|
||||
public static void saveItems(IItemHandler handler, int id, NBTTagCompound nbt) {
|
||||
public static void writeItems(IItemHandler handler, int id, NBTTagCompound nbt) {
|
||||
NBTTagList tagList = new NBTTagList();
|
||||
|
||||
for (int i = 0; i < handler.getSlots(); i++) {
|
||||
@@ -44,7 +44,7 @@ public class RefinedStorageUtils {
|
||||
nbt.setTag(String.format(NBT_INVENTORY, id), tagList);
|
||||
}
|
||||
|
||||
public static void restoreItems(IItemHandler handler, int id, NBTTagCompound nbt) {
|
||||
public static void readItems(IItemHandler handler, int id, NBTTagCompound nbt) {
|
||||
String name = String.format(NBT_INVENTORY, id);
|
||||
|
||||
if (nbt.hasKey(name)) {
|
||||
@@ -60,7 +60,7 @@ public class RefinedStorageUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static void saveItemsLegacy(IInventory inventory, int id, NBTTagCompound nbt) {
|
||||
public static void writeItemsLegacy(IInventory inventory, int id, NBTTagCompound nbt) {
|
||||
NBTTagList tagList = new NBTTagList();
|
||||
|
||||
for (int i = 0; i < inventory.getSizeInventory(); i++) {
|
||||
@@ -78,7 +78,7 @@ public class RefinedStorageUtils {
|
||||
nbt.setTag(String.format(NBT_INVENTORY, id), tagList);
|
||||
}
|
||||
|
||||
public static void restoreItemsLegacy(IInventory inventory, int id, NBTTagCompound nbt) {
|
||||
public static void readItemsLegacy(IInventory inventory, int id, NBTTagCompound nbt) {
|
||||
String name = String.format(NBT_INVENTORY, id);
|
||||
|
||||
if (nbt.hasKey(name)) {
|
||||
|
||||
@@ -33,7 +33,7 @@ public class MessageTileContainerUpdate implements IMessage, IMessageHandler<Mes
|
||||
tile = ClientProxy.getWorld().getTileEntity(new BlockPos(x, y, z));
|
||||
|
||||
if (tile instanceof ISynchronizedContainer) {
|
||||
((ISynchronizedContainer) tile).receiveContainerData(buf);
|
||||
((ISynchronizedContainer) tile).readContainerData(buf);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -45,7 +45,7 @@ public class MessageTileContainerUpdate implements IMessage, IMessageHandler<Mes
|
||||
buf.writeInt(tile.getPos().getZ());
|
||||
|
||||
if (tile instanceof ISynchronizedContainer) {
|
||||
((ISynchronizedContainer) tile).sendContainerData(buf);
|
||||
((ISynchronizedContainer) tile).writeContainerData(buf);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public class CraftingTaskScheduler {
|
||||
}
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound tag) {
|
||||
public void read(NBTTagCompound tag) {
|
||||
if (tag.hasKey(NBT_SCHEDULED)) {
|
||||
scheduledFor = ItemStack.loadItemStackFromNBT(tag.getCompoundTag(NBT_SCHEDULED));
|
||||
}
|
||||
|
||||
@@ -4,9 +4,9 @@ import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.inventory.Container;
|
||||
|
||||
public interface ISynchronizedContainer {
|
||||
void receiveContainerData(ByteBuf buf);
|
||||
void readContainerData(ByteBuf buf);
|
||||
|
||||
void sendContainerData(ByteBuf buf);
|
||||
void writeContainerData(ByteBuf buf);
|
||||
|
||||
Class<? extends Container> getContainer();
|
||||
}
|
||||
|
||||
@@ -49,40 +49,53 @@ public abstract class TileBase extends TileEntity implements ITickable {
|
||||
return direction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
|
||||
direction = EnumFacing.getFront(nbt.getInteger(NBT_DIRECTION));
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbt) {
|
||||
nbt.setInteger(NBT_DIRECTION, direction.ordinal());
|
||||
|
||||
return super.writeToNBT(nbt);
|
||||
}
|
||||
|
||||
public NBTTagCompound writeToUpdatePacketNBT(NBTTagCompound tag) {
|
||||
public NBTTagCompound write(NBTTagCompound tag) {
|
||||
tag.setInteger(NBT_DIRECTION, direction.ordinal());
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
public void readFromUpdatePacketNBT(NBTTagCompound tag) {
|
||||
public NBTTagCompound writeUpdate(NBTTagCompound tag) {
|
||||
tag.setByte("U", (byte) 1);
|
||||
tag.setInteger(NBT_DIRECTION, direction.ordinal());
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
public void read(NBTTagCompound tag) {
|
||||
direction = EnumFacing.getFront(tag.getInteger(NBT_DIRECTION));
|
||||
}
|
||||
|
||||
public void readUpdate(NBTTagCompound tag) {
|
||||
direction = EnumFacing.getFront(tag.getInteger(NBT_DIRECTION));
|
||||
|
||||
RefinedStorageUtils.updateBlock(worldObj, pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SPacketUpdateTileEntity getUpdatePacket() {
|
||||
return new SPacketUpdateTileEntity(pos, 1, writeToUpdatePacketNBT(new NBTTagCompound()));
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
|
||||
if (nbt.hasKey("U")) {
|
||||
readUpdate(nbt);
|
||||
} else {
|
||||
read(nbt);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound tag) {
|
||||
return write(super.writeToNBT(tag));
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getUpdateTag() {
|
||||
return writeUpdate(super.getUpdateTag());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) {
|
||||
readFromUpdatePacketNBT(packet.getNbtCompound());
|
||||
|
||||
RefinedStorageUtils.updateBlock(worldObj, pos);
|
||||
readUpdate(packet.getNbtCompound());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -83,41 +83,43 @@ public class TileConstructor extends TileMachine implements ICompareConfig {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
public void read(NBTTagCompound tag) {
|
||||
super.read(tag);
|
||||
|
||||
if (nbt.hasKey(NBT_COMPARE)) {
|
||||
compare = nbt.getInteger(NBT_COMPARE);
|
||||
if (tag.hasKey(NBT_COMPARE)) {
|
||||
compare = tag.getInteger(NBT_COMPARE);
|
||||
}
|
||||
|
||||
RefinedStorageUtils.restoreItems(filter, 0, nbt);
|
||||
RefinedStorageUtils.restoreItems(upgrades, 1, nbt);
|
||||
RefinedStorageUtils.readItems(filter, 0, tag);
|
||||
RefinedStorageUtils.readItems(upgrades, 1, tag);
|
||||
|
||||
scheduler.readFromNBT(nbt);
|
||||
scheduler.read(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbt) {
|
||||
nbt.setInteger(NBT_COMPARE, compare);
|
||||
public NBTTagCompound write(NBTTagCompound tag) {
|
||||
super.write(tag);
|
||||
|
||||
RefinedStorageUtils.saveItems(filter, 0, nbt);
|
||||
RefinedStorageUtils.saveItems(upgrades, 1, nbt);
|
||||
tag.setInteger(NBT_COMPARE, compare);
|
||||
|
||||
scheduler.writeToNBT(nbt);
|
||||
RefinedStorageUtils.writeItems(filter, 0, tag);
|
||||
RefinedStorageUtils.writeItems(upgrades, 1, tag);
|
||||
|
||||
return super.writeToNBT(nbt);
|
||||
scheduler.writeToNBT(tag);
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveContainerData(ByteBuf buf) {
|
||||
super.receiveContainerData(buf);
|
||||
public void readContainerData(ByteBuf buf) {
|
||||
super.readContainerData(buf);
|
||||
|
||||
compare = buf.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendContainerData(ByteBuf buf) {
|
||||
super.sendContainerData(buf);
|
||||
public void writeContainerData(ByteBuf buf) {
|
||||
super.writeContainerData(buf);
|
||||
|
||||
buf.writeInt(compare);
|
||||
}
|
||||
|
||||
@@ -494,8 +494,30 @@ public class TileController extends TileBase implements IEnergyReceiver, ISynchr
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
public NBTTagCompound write(NBTTagCompound tag) {
|
||||
super.write(tag);
|
||||
|
||||
energy.writeToNBT(tag);
|
||||
|
||||
tag.setInteger(RedstoneMode.NBT, redstoneMode.id);
|
||||
|
||||
NBTTagList list = new NBTTagList();
|
||||
|
||||
for (ICraftingTask task : craftingTasks) {
|
||||
NBTTagCompound taskTag = new NBTTagCompound();
|
||||
task.writeToNBT(taskTag);
|
||||
list.appendTag(taskTag);
|
||||
}
|
||||
|
||||
tag.setTag(NBT_CRAFTING_TASKS, list);
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void read(NBTTagCompound nbt) {
|
||||
super.read(nbt);
|
||||
|
||||
energy.readFromNBT(nbt);
|
||||
|
||||
@@ -526,34 +548,17 @@ public class TileController extends TileBase implements IEnergyReceiver, ISynchr
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbt) {
|
||||
energy.writeToNBT(nbt);
|
||||
public NBTTagCompound writeUpdate(NBTTagCompound tag) {
|
||||
super.writeUpdate(tag);
|
||||
|
||||
nbt.setInteger(RedstoneMode.NBT, redstoneMode.id);
|
||||
|
||||
NBTTagList list = new NBTTagList();
|
||||
|
||||
for (ICraftingTask task : craftingTasks) {
|
||||
NBTTagCompound taskTag = new NBTTagCompound();
|
||||
task.writeToNBT(taskTag);
|
||||
list.appendTag(taskTag);
|
||||
}
|
||||
|
||||
nbt.setTag(NBT_CRAFTING_TASKS, list);
|
||||
|
||||
return super.writeToNBT(nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToUpdatePacketNBT(NBTTagCompound tag) {
|
||||
tag.setInteger(NBT_DESC_ENERGY, getEnergyStored(null));
|
||||
|
||||
return super.writeToUpdatePacketNBT(tag);
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromUpdatePacketNBT(NBTTagCompound tag) {
|
||||
super.readFromUpdatePacketNBT(tag);
|
||||
public void readUpdate(NBTTagCompound tag) {
|
||||
super.readUpdate(tag);
|
||||
|
||||
setEnergyStored(tag.getInteger(NBT_DESC_ENERGY));
|
||||
}
|
||||
@@ -612,7 +617,7 @@ public class TileController extends TileBase implements IEnergyReceiver, ISynchr
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveContainerData(ByteBuf buf) {
|
||||
public void readContainerData(ByteBuf buf) {
|
||||
setEnergyStored(buf.readInt());
|
||||
energyUsage = buf.readInt();
|
||||
|
||||
@@ -637,7 +642,7 @@ public class TileController extends TileBase implements IEnergyReceiver, ISynchr
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendContainerData(ByteBuf buf) {
|
||||
public void writeContainerData(ByteBuf buf) {
|
||||
buf.writeInt(getEnergyStored(null));
|
||||
buf.writeInt(energyUsage);
|
||||
|
||||
|
||||
@@ -100,8 +100,8 @@ public class TileDestructor extends TileMachine implements ICompareConfig, IMode
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
public void read(NBTTagCompound nbt) {
|
||||
super.read(nbt);
|
||||
|
||||
if (nbt.hasKey(NBT_COMPARE)) {
|
||||
compare = nbt.getInteger(NBT_COMPARE);
|
||||
@@ -111,32 +111,34 @@ public class TileDestructor extends TileMachine implements ICompareConfig, IMode
|
||||
mode = nbt.getInteger(NBT_MODE);
|
||||
}
|
||||
|
||||
RefinedStorageUtils.restoreItems(filters, 0, nbt);
|
||||
RefinedStorageUtils.restoreItems(upgrades, 1, nbt);
|
||||
RefinedStorageUtils.readItems(filters, 0, nbt);
|
||||
RefinedStorageUtils.readItems(upgrades, 1, nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbt) {
|
||||
nbt.setInteger(NBT_COMPARE, compare);
|
||||
nbt.setInteger(NBT_MODE, mode);
|
||||
public NBTTagCompound write(NBTTagCompound tag) {
|
||||
super.write(tag);
|
||||
|
||||
RefinedStorageUtils.saveItems(filters, 0, nbt);
|
||||
RefinedStorageUtils.saveItems(upgrades, 1, nbt);
|
||||
tag.setInteger(NBT_COMPARE, compare);
|
||||
tag.setInteger(NBT_MODE, mode);
|
||||
|
||||
return super.writeToNBT(nbt);
|
||||
RefinedStorageUtils.writeItems(filters, 0, tag);
|
||||
RefinedStorageUtils.writeItems(upgrades, 1, tag);
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveContainerData(ByteBuf buf) {
|
||||
super.receiveContainerData(buf);
|
||||
public void readContainerData(ByteBuf buf) {
|
||||
super.readContainerData(buf);
|
||||
|
||||
compare = buf.readInt();
|
||||
mode = buf.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendContainerData(ByteBuf buf) {
|
||||
super.sendContainerData(buf);
|
||||
public void writeContainerData(ByteBuf buf) {
|
||||
super.writeContainerData(buf);
|
||||
|
||||
buf.writeInt(compare);
|
||||
buf.writeInt(mode);
|
||||
|
||||
@@ -136,8 +136,8 @@ public class TileDetector extends TileMachine implements ICompareConfig {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
public void read(NBTTagCompound nbt) {
|
||||
super.read(nbt);
|
||||
|
||||
if (nbt.hasKey(NBT_COMPARE)) {
|
||||
compare = nbt.getInteger(NBT_COMPARE);
|
||||
@@ -151,37 +151,41 @@ public class TileDetector extends TileMachine implements ICompareConfig {
|
||||
amount = nbt.getInteger(NBT_AMOUNT);
|
||||
}
|
||||
|
||||
RefinedStorageUtils.restoreItems(filter, 0, nbt);
|
||||
RefinedStorageUtils.readItems(filter, 0, nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbt) {
|
||||
nbt.setInteger(NBT_COMPARE, compare);
|
||||
nbt.setInteger(NBT_MODE, mode);
|
||||
nbt.setInteger(NBT_AMOUNT, amount);
|
||||
public NBTTagCompound write(NBTTagCompound tag) {
|
||||
super.write(tag);
|
||||
|
||||
RefinedStorageUtils.saveItems(filter, 0, nbt);
|
||||
tag.setInteger(NBT_COMPARE, compare);
|
||||
tag.setInteger(NBT_MODE, mode);
|
||||
tag.setInteger(NBT_AMOUNT, amount);
|
||||
|
||||
return super.writeToNBT(nbt);
|
||||
RefinedStorageUtils.writeItems(filter, 0, tag);
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromUpdatePacketNBT(NBTTagCompound tag) {
|
||||
super.readFromUpdatePacketNBT(tag);
|
||||
public void readUpdate(NBTTagCompound tag) {
|
||||
super.readUpdate(tag);
|
||||
|
||||
powered = tag.getBoolean(NBT_DESC_POWERED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToUpdatePacketNBT(NBTTagCompound tag) {
|
||||
public NBTTagCompound writeUpdate(NBTTagCompound tag) {
|
||||
super.writeUpdate(tag);
|
||||
|
||||
tag.setBoolean(NBT_DESC_POWERED, powered);
|
||||
|
||||
return super.writeToUpdatePacketNBT(tag);
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendContainerData(ByteBuf buf) {
|
||||
super.sendContainerData(buf);
|
||||
public void writeContainerData(ByteBuf buf) {
|
||||
super.writeContainerData(buf);
|
||||
|
||||
buf.writeInt(compare);
|
||||
buf.writeInt(mode);
|
||||
@@ -189,8 +193,8 @@ public class TileDetector extends TileMachine implements ICompareConfig {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveContainerData(ByteBuf buf) {
|
||||
super.receiveContainerData(buf);
|
||||
public void readContainerData(ByteBuf buf) {
|
||||
super.readContainerData(buf);
|
||||
|
||||
compare = buf.readInt();
|
||||
mode = buf.readInt();
|
||||
|
||||
@@ -85,11 +85,11 @@ public class TileDiskDrive extends TileMachine implements IStorageProvider, ISto
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
public void read(NBTTagCompound nbt) {
|
||||
super.read(nbt);
|
||||
|
||||
RefinedStorageUtils.restoreItems(disks, 0, nbt);
|
||||
RefinedStorageUtils.restoreItems(filters, 1, nbt);
|
||||
RefinedStorageUtils.readItems(disks, 0, nbt);
|
||||
RefinedStorageUtils.readItems(filters, 1, nbt);
|
||||
|
||||
if (nbt.hasKey(NBT_PRIORITY)) {
|
||||
priority = nbt.getInteger(NBT_PRIORITY);
|
||||
@@ -105,20 +105,22 @@ public class TileDiskDrive extends TileMachine implements IStorageProvider, ISto
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbt) {
|
||||
RefinedStorageUtils.saveItems(disks, 0, nbt);
|
||||
RefinedStorageUtils.saveItems(filters, 1, nbt);
|
||||
public NBTTagCompound write(NBTTagCompound tag) {
|
||||
super.write(tag);
|
||||
|
||||
nbt.setInteger(NBT_PRIORITY, priority);
|
||||
nbt.setInteger(NBT_COMPARE, compare);
|
||||
nbt.setInteger(NBT_MODE, mode);
|
||||
RefinedStorageUtils.writeItems(disks, 0, tag);
|
||||
RefinedStorageUtils.writeItems(filters, 1, tag);
|
||||
|
||||
return super.writeToNBT(nbt);
|
||||
tag.setInteger(NBT_PRIORITY, priority);
|
||||
tag.setInteger(NBT_COMPARE, compare);
|
||||
tag.setInteger(NBT_MODE, mode);
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendContainerData(ByteBuf buf) {
|
||||
super.sendContainerData(buf);
|
||||
public void writeContainerData(ByteBuf buf) {
|
||||
super.writeContainerData(buf);
|
||||
|
||||
buf.writeInt(priority);
|
||||
buf.writeInt(compare);
|
||||
@@ -126,8 +128,8 @@ public class TileDiskDrive extends TileMachine implements IStorageProvider, ISto
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveContainerData(ByteBuf buf) {
|
||||
super.receiveContainerData(buf);
|
||||
public void readContainerData(ByteBuf buf) {
|
||||
super.readContainerData(buf);
|
||||
|
||||
priority = buf.readInt();
|
||||
compare = buf.readInt();
|
||||
|
||||
@@ -81,41 +81,43 @@ public class TileExporter extends TileMachine implements ICompareConfig {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
public void read(NBTTagCompound nbt) {
|
||||
super.read(nbt);
|
||||
|
||||
if (nbt.hasKey(NBT_COMPARE)) {
|
||||
compare = nbt.getInteger(NBT_COMPARE);
|
||||
}
|
||||
|
||||
RefinedStorageUtils.restoreItems(filters, 0, nbt);
|
||||
RefinedStorageUtils.restoreItems(upgrades, 1, nbt);
|
||||
RefinedStorageUtils.readItems(filters, 0, nbt);
|
||||
RefinedStorageUtils.readItems(upgrades, 1, nbt);
|
||||
|
||||
scheduler.readFromNBT(nbt);
|
||||
scheduler.read(nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbt) {
|
||||
nbt.setInteger(NBT_COMPARE, compare);
|
||||
public NBTTagCompound write(NBTTagCompound tag) {
|
||||
super.write(tag);
|
||||
|
||||
RefinedStorageUtils.saveItems(filters, 0, nbt);
|
||||
RefinedStorageUtils.saveItems(upgrades, 1, nbt);
|
||||
tag.setInteger(NBT_COMPARE, compare);
|
||||
|
||||
scheduler.writeToNBT(nbt);
|
||||
RefinedStorageUtils.writeItems(filters, 0, tag);
|
||||
RefinedStorageUtils.writeItems(upgrades, 1, tag);
|
||||
|
||||
return super.writeToNBT(nbt);
|
||||
scheduler.writeToNBT(tag);
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveContainerData(ByteBuf buf) {
|
||||
super.receiveContainerData(buf);
|
||||
public void readContainerData(ByteBuf buf) {
|
||||
super.readContainerData(buf);
|
||||
|
||||
compare = buf.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendContainerData(ByteBuf buf) {
|
||||
super.sendContainerData(buf);
|
||||
public void writeContainerData(ByteBuf buf) {
|
||||
super.writeContainerData(buf);
|
||||
|
||||
buf.writeInt(compare);
|
||||
}
|
||||
|
||||
@@ -156,8 +156,8 @@ public class TileExternalStorage extends TileMachine implements IStorageProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendContainerData(ByteBuf buf) {
|
||||
super.sendContainerData(buf);
|
||||
public void writeContainerData(ByteBuf buf) {
|
||||
super.writeContainerData(buf);
|
||||
|
||||
buf.writeInt(priority);
|
||||
|
||||
@@ -188,8 +188,8 @@ public class TileExternalStorage extends TileMachine implements IStorageProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveContainerData(ByteBuf buf) {
|
||||
super.receiveContainerData(buf);
|
||||
public void readContainerData(ByteBuf buf) {
|
||||
super.readContainerData(buf);
|
||||
|
||||
priority = buf.readInt();
|
||||
stored = buf.readInt();
|
||||
@@ -203,10 +203,10 @@ public class TileExternalStorage extends TileMachine implements IStorageProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
public void read(NBTTagCompound nbt) {
|
||||
super.read(nbt);
|
||||
|
||||
RefinedStorageUtils.restoreItems(filters, 0, nbt);
|
||||
RefinedStorageUtils.readItems(filters, 0, nbt);
|
||||
|
||||
if (nbt.hasKey(NBT_PRIORITY)) {
|
||||
priority = nbt.getInteger(NBT_PRIORITY);
|
||||
@@ -222,14 +222,16 @@ public class TileExternalStorage extends TileMachine implements IStorageProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbt) {
|
||||
RefinedStorageUtils.saveItems(filters, 0, nbt);
|
||||
public NBTTagCompound write(NBTTagCompound tag) {
|
||||
super.write(tag);
|
||||
|
||||
nbt.setInteger(NBT_PRIORITY, priority);
|
||||
nbt.setInteger(NBT_COMPARE, compare);
|
||||
nbt.setInteger(NBT_MODE, mode);
|
||||
RefinedStorageUtils.writeItems(filters, 0, tag);
|
||||
|
||||
return super.writeToNBT(nbt);
|
||||
tag.setInteger(NBT_PRIORITY, priority);
|
||||
tag.setInteger(NBT_COMPARE, compare);
|
||||
tag.setInteger(NBT_MODE, mode);
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -88,8 +88,8 @@ public class TileImporter extends TileMachine implements ICompareConfig, IModeCo
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
public void read(NBTTagCompound nbt) {
|
||||
super.read(nbt);
|
||||
|
||||
if (nbt.hasKey(NBT_COMPARE)) {
|
||||
compare = nbt.getInteger(NBT_COMPARE);
|
||||
@@ -99,32 +99,34 @@ public class TileImporter extends TileMachine implements ICompareConfig, IModeCo
|
||||
mode = nbt.getInteger(NBT_MODE);
|
||||
}
|
||||
|
||||
RefinedStorageUtils.restoreItems(filters, 0, nbt);
|
||||
RefinedStorageUtils.restoreItems(upgrades, 1, nbt);
|
||||
RefinedStorageUtils.readItems(filters, 0, nbt);
|
||||
RefinedStorageUtils.readItems(upgrades, 1, nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbt) {
|
||||
nbt.setInteger(NBT_COMPARE, compare);
|
||||
nbt.setInteger(NBT_MODE, mode);
|
||||
public NBTTagCompound write(NBTTagCompound tag) {
|
||||
super.write(tag);
|
||||
|
||||
RefinedStorageUtils.saveItems(filters, 0, nbt);
|
||||
RefinedStorageUtils.saveItems(upgrades, 1, nbt);
|
||||
tag.setInteger(NBT_COMPARE, compare);
|
||||
tag.setInteger(NBT_MODE, mode);
|
||||
|
||||
return super.writeToNBT(nbt);
|
||||
RefinedStorageUtils.writeItems(filters, 0, tag);
|
||||
RefinedStorageUtils.writeItems(upgrades, 1, tag);
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveContainerData(ByteBuf buf) {
|
||||
super.receiveContainerData(buf);
|
||||
public void readContainerData(ByteBuf buf) {
|
||||
super.readContainerData(buf);
|
||||
|
||||
compare = buf.readInt();
|
||||
mode = buf.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendContainerData(ByteBuf buf) {
|
||||
super.sendContainerData(buf);
|
||||
public void writeContainerData(ByteBuf buf) {
|
||||
super.writeContainerData(buf);
|
||||
|
||||
buf.writeInt(compare);
|
||||
buf.writeInt(mode);
|
||||
|
||||
@@ -108,11 +108,11 @@ public class TileInterface extends TileMachine implements ICompareConfig {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
public void read(NBTTagCompound nbt) {
|
||||
super.read(nbt);
|
||||
|
||||
RefinedStorageUtils.restoreItems(items, 0, nbt);
|
||||
RefinedStorageUtils.restoreItems(upgrades, 1, nbt);
|
||||
RefinedStorageUtils.readItems(items, 0, nbt);
|
||||
RefinedStorageUtils.readItems(upgrades, 1, nbt);
|
||||
|
||||
if (nbt.hasKey(NBT_COMPARE)) {
|
||||
compare = nbt.getInteger(NBT_COMPARE);
|
||||
@@ -120,26 +120,28 @@ public class TileInterface extends TileMachine implements ICompareConfig {
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbt) {
|
||||
RefinedStorageUtils.saveItems(items, 0, nbt);
|
||||
RefinedStorageUtils.saveItems(upgrades, 1, nbt);
|
||||
public NBTTagCompound write(NBTTagCompound tag) {
|
||||
super.write(tag);
|
||||
|
||||
nbt.setInteger(NBT_COMPARE, compare);
|
||||
RefinedStorageUtils.writeItems(items, 0, tag);
|
||||
RefinedStorageUtils.writeItems(upgrades, 1, tag);
|
||||
|
||||
return super.writeToNBT(nbt);
|
||||
tag.setInteger(NBT_COMPARE, compare);
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void receiveContainerData(ByteBuf buf) {
|
||||
super.receiveContainerData(buf);
|
||||
public void readContainerData(ByteBuf buf) {
|
||||
super.readContainerData(buf);
|
||||
|
||||
compare = buf.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendContainerData(ByteBuf buf) {
|
||||
super.sendContainerData(buf);
|
||||
public void writeContainerData(ByteBuf buf) {
|
||||
super.writeContainerData(buf);
|
||||
|
||||
buf.writeInt(compare);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public abstract class TileMachine extends TileBase implements ISynchronizedContainer, IRedstoneModeConfig {
|
||||
public static final String NBT_DESC_CONNECTED = "Connected";
|
||||
public static final String NBT_CONNECTED = "Connected";
|
||||
|
||||
protected boolean connected;
|
||||
protected boolean wasConnected;
|
||||
@@ -131,18 +131,18 @@ public abstract class TileMachine extends TileBase implements ISynchronizedConta
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveContainerData(ByteBuf buf) {
|
||||
public void readContainerData(ByteBuf buf) {
|
||||
redstoneMode = RedstoneMode.getById(buf.readInt());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendContainerData(ByteBuf buf) {
|
||||
public void writeContainerData(ByteBuf buf) {
|
||||
buf.writeInt(redstoneMode.id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
public void read(NBTTagCompound nbt) {
|
||||
super.read(nbt);
|
||||
|
||||
if (nbt.hasKey(RedstoneMode.NBT)) {
|
||||
redstoneMode = RedstoneMode.getById(nbt.getInteger(RedstoneMode.NBT));
|
||||
@@ -150,22 +150,26 @@ public abstract class TileMachine extends TileBase implements ISynchronizedConta
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbt) {
|
||||
nbt.setInteger(RedstoneMode.NBT, redstoneMode.id);
|
||||
public NBTTagCompound write(NBTTagCompound tag) {
|
||||
super.write(tag);
|
||||
|
||||
return super.writeToNBT(nbt);
|
||||
tag.setInteger(RedstoneMode.NBT, redstoneMode.id);
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
public NBTTagCompound writeToUpdatePacketNBT(NBTTagCompound tag) {
|
||||
tag.setBoolean(NBT_DESC_CONNECTED, isActive());
|
||||
public NBTTagCompound writeUpdate(NBTTagCompound tag) {
|
||||
super.writeUpdate(tag);
|
||||
|
||||
return super.writeToUpdatePacketNBT(tag);
|
||||
tag.setBoolean(NBT_CONNECTED, isActive());
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
public void readFromUpdatePacketNBT(NBTTagCompound tag) {
|
||||
super.readFromUpdatePacketNBT(tag);
|
||||
public void readUpdate(NBTTagCompound tag) {
|
||||
super.readUpdate(tag);
|
||||
|
||||
connected = tag.getBoolean(NBT_DESC_CONNECTED);
|
||||
connected = tag.getBoolean(NBT_CONNECTED);
|
||||
}
|
||||
|
||||
public abstract int getEnergyUsage();
|
||||
|
||||
@@ -64,10 +64,10 @@ public class TileStorage extends TileMachine implements IStorageProvider, IStora
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
public void read(NBTTagCompound nbt) {
|
||||
super.read(nbt);
|
||||
|
||||
RefinedStorageUtils.restoreItems(filters, 0, nbt);
|
||||
RefinedStorageUtils.readItems(filters, 0, nbt);
|
||||
|
||||
if (nbt.hasKey(NBT_PRIORITY)) {
|
||||
priority = nbt.getInteger(NBT_PRIORITY);
|
||||
@@ -87,15 +87,17 @@ public class TileStorage extends TileMachine implements IStorageProvider, IStora
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbt) {
|
||||
RefinedStorageUtils.saveItems(filters, 0, nbt);
|
||||
public NBTTagCompound write(NBTTagCompound tag) {
|
||||
super.write(tag);
|
||||
|
||||
nbt.setInteger(NBT_PRIORITY, priority);
|
||||
nbt.setTag(NBT_STORAGE, storageTag);
|
||||
nbt.setInteger(NBT_COMPARE, compare);
|
||||
nbt.setInteger(NBT_MODE, mode);
|
||||
RefinedStorageUtils.writeItems(filters, 0, tag);
|
||||
|
||||
return super.writeToNBT(nbt);
|
||||
tag.setInteger(NBT_PRIORITY, priority);
|
||||
tag.setTag(NBT_STORAGE, storageTag);
|
||||
tag.setInteger(NBT_COMPARE, compare);
|
||||
tag.setInteger(NBT_MODE, mode);
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
public EnumStorageType getType() {
|
||||
@@ -107,8 +109,8 @@ public class TileStorage extends TileMachine implements IStorageProvider, IStora
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendContainerData(ByteBuf buf) {
|
||||
super.sendContainerData(buf);
|
||||
public void writeContainerData(ByteBuf buf) {
|
||||
super.writeContainerData(buf);
|
||||
|
||||
buf.writeInt(NBTStorage.getStored(storageTag));
|
||||
buf.writeInt(priority);
|
||||
@@ -117,8 +119,8 @@ public class TileStorage extends TileMachine implements IStorageProvider, IStora
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveContainerData(ByteBuf buf) {
|
||||
super.receiveContainerData(buf);
|
||||
public void readContainerData(ByteBuf buf) {
|
||||
super.readContainerData(buf);
|
||||
|
||||
stored = buf.readInt();
|
||||
priority = buf.readInt();
|
||||
|
||||
@@ -28,17 +28,19 @@ public class TileWirelessTransmitter extends TileMachine {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
public void read(NBTTagCompound nbt) {
|
||||
super.read(nbt);
|
||||
|
||||
RefinedStorageUtils.restoreItems(upgrades, 0, nbt);
|
||||
RefinedStorageUtils.readItems(upgrades, 0, nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbt) {
|
||||
RefinedStorageUtils.saveItems(upgrades, 0, nbt);
|
||||
public NBTTagCompound write(NBTTagCompound tag) {
|
||||
super.write(tag);
|
||||
|
||||
return super.writeToNBT(nbt);
|
||||
RefinedStorageUtils.writeItems(upgrades, 0, tag);
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
public int getRange() {
|
||||
|
||||
@@ -55,19 +55,21 @@ public class TileCrafter extends TileMachine {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
public void read(NBTTagCompound nbt) {
|
||||
super.read(nbt);
|
||||
|
||||
RefinedStorageUtils.restoreItems(patterns, 0, nbt);
|
||||
RefinedStorageUtils.restoreItems(upgrades, 1, nbt);
|
||||
RefinedStorageUtils.readItems(patterns, 0, nbt);
|
||||
RefinedStorageUtils.readItems(upgrades, 1, nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbt) {
|
||||
RefinedStorageUtils.saveItems(patterns, 0, nbt);
|
||||
RefinedStorageUtils.saveItems(upgrades, 1, nbt);
|
||||
public NBTTagCompound write(NBTTagCompound tag) {
|
||||
super.write(tag);
|
||||
|
||||
return super.writeToNBT(nbt);
|
||||
RefinedStorageUtils.writeItems(patterns, 0, tag);
|
||||
RefinedStorageUtils.writeItems(upgrades, 1, tag);
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
public int getSpeed() {
|
||||
|
||||
@@ -30,8 +30,8 @@ public class TileCraftingMonitor extends TileMachine {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendContainerData(ByteBuf buf) {
|
||||
super.sendContainerData(buf);
|
||||
public void writeContainerData(ByteBuf buf) {
|
||||
super.writeContainerData(buf);
|
||||
|
||||
if (connected) {
|
||||
buf.writeInt(controller.getCraftingTasks().size());
|
||||
@@ -51,8 +51,8 @@ public class TileCraftingMonitor extends TileMachine {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveContainerData(ByteBuf buf) {
|
||||
super.receiveContainerData(buf);
|
||||
public void readContainerData(ByteBuf buf) {
|
||||
super.readContainerData(buf);
|
||||
|
||||
int size = buf.readInt();
|
||||
|
||||
|
||||
@@ -18,19 +18,21 @@ public class TileProcessingPatternEncoder extends TileBase {
|
||||
private BasicItemHandler configuration = new BasicItemHandler(9 * 2, this);
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbt) {
|
||||
RefinedStorageUtils.saveItems(patterns, 0, nbt);
|
||||
RefinedStorageUtils.saveItems(configuration, 1, nbt);
|
||||
public NBTTagCompound write(NBTTagCompound tag) {
|
||||
super.write(tag);
|
||||
|
||||
return super.writeToNBT(nbt);
|
||||
RefinedStorageUtils.writeItems(patterns, 0, tag);
|
||||
RefinedStorageUtils.writeItems(configuration, 1, tag);
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
public void read(NBTTagCompound nbt) {
|
||||
super.read(nbt);
|
||||
|
||||
RefinedStorageUtils.restoreItems(patterns, 0, nbt);
|
||||
RefinedStorageUtils.restoreItems(configuration, 1, nbt);
|
||||
RefinedStorageUtils.readItems(patterns, 0, nbt);
|
||||
RefinedStorageUtils.readItems(configuration, 1, nbt);
|
||||
}
|
||||
|
||||
public void onCreatePattern() {
|
||||
|
||||
@@ -293,11 +293,11 @@ public class TileGrid extends TileMachine implements IGrid {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
public void read(NBTTagCompound nbt) {
|
||||
super.read(nbt);
|
||||
|
||||
RefinedStorageUtils.restoreItemsLegacy(matrix, 0, nbt);
|
||||
RefinedStorageUtils.restoreItems(patterns, 1, nbt);
|
||||
RefinedStorageUtils.readItemsLegacy(matrix, 0, nbt);
|
||||
RefinedStorageUtils.readItems(patterns, 1, nbt);
|
||||
|
||||
if (nbt.hasKey(NBT_SORTING_DIRECTION)) {
|
||||
sortingDirection = nbt.getInteger(NBT_SORTING_DIRECTION);
|
||||
@@ -313,20 +313,22 @@ public class TileGrid extends TileMachine implements IGrid {
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbt) {
|
||||
RefinedStorageUtils.saveItemsLegacy(matrix, 0, nbt);
|
||||
RefinedStorageUtils.saveItems(patterns, 1, nbt);
|
||||
public NBTTagCompound write(NBTTagCompound tag) {
|
||||
super.write(tag);
|
||||
|
||||
nbt.setInteger(NBT_SORTING_DIRECTION, sortingDirection);
|
||||
nbt.setInteger(NBT_SORTING_TYPE, sortingType);
|
||||
nbt.setInteger(NBT_SEARCH_BOX_MODE, searchBoxMode);
|
||||
RefinedStorageUtils.writeItemsLegacy(matrix, 0, tag);
|
||||
RefinedStorageUtils.writeItems(patterns, 1, tag);
|
||||
|
||||
return super.writeToNBT(nbt);
|
||||
tag.setInteger(NBT_SORTING_DIRECTION, sortingDirection);
|
||||
tag.setInteger(NBT_SORTING_TYPE, sortingType);
|
||||
tag.setInteger(NBT_SEARCH_BOX_MODE, searchBoxMode);
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendContainerData(ByteBuf buf) {
|
||||
super.sendContainerData(buf);
|
||||
public void writeContainerData(ByteBuf buf) {
|
||||
super.writeContainerData(buf);
|
||||
|
||||
buf.writeInt(sortingDirection);
|
||||
buf.writeInt(sortingType);
|
||||
@@ -340,8 +342,8 @@ public class TileGrid extends TileMachine implements IGrid {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveContainerData(ByteBuf buf) {
|
||||
super.receiveContainerData(buf);
|
||||
public void readContainerData(ByteBuf buf) {
|
||||
super.readContainerData(buf);
|
||||
|
||||
sortingDirection = buf.readInt();
|
||||
sortingType = buf.readInt();
|
||||
|
||||
@@ -95,11 +95,11 @@ public class TileSolderer extends TileMachine {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
public void read(NBTTagCompound nbt) {
|
||||
super.read(nbt);
|
||||
|
||||
RefinedStorageUtils.restoreItems(items, 0, nbt);
|
||||
RefinedStorageUtils.restoreItems(upgrades, 1, nbt);
|
||||
RefinedStorageUtils.readItems(items, 0, nbt);
|
||||
RefinedStorageUtils.readItems(upgrades, 1, nbt);
|
||||
|
||||
recipe = SoldererRegistry.getRecipe(items);
|
||||
|
||||
@@ -113,41 +113,45 @@ public class TileSolderer extends TileMachine {
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbt) {
|
||||
RefinedStorageUtils.saveItems(items, 0, nbt);
|
||||
RefinedStorageUtils.saveItems(upgrades, 1, nbt);
|
||||
public NBTTagCompound write(NBTTagCompound tag) {
|
||||
super.write(tag);
|
||||
|
||||
nbt.setBoolean(NBT_WORKING, working);
|
||||
nbt.setInteger(NBT_PROGRESS, progress);
|
||||
RefinedStorageUtils.writeItems(items, 0, tag);
|
||||
RefinedStorageUtils.writeItems(upgrades, 1, tag);
|
||||
|
||||
return super.writeToNBT(nbt);
|
||||
tag.setBoolean(NBT_WORKING, working);
|
||||
tag.setInteger(NBT_PROGRESS, progress);
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToUpdatePacketNBT(NBTTagCompound tag) {
|
||||
public NBTTagCompound writeUpdate(NBTTagCompound tag) {
|
||||
super.writeUpdate(tag);
|
||||
|
||||
tag.setBoolean(NBT_WORKING, working);
|
||||
|
||||
return super.writeToUpdatePacketNBT(tag);
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromUpdatePacketNBT(NBTTagCompound tag) {
|
||||
super.readFromUpdatePacketNBT(tag);
|
||||
public void readUpdate(NBTTagCompound tag) {
|
||||
super.readUpdate(tag);
|
||||
|
||||
working = tag.getBoolean(NBT_WORKING);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveContainerData(ByteBuf buf) {
|
||||
super.receiveContainerData(buf);
|
||||
public void readContainerData(ByteBuf buf) {
|
||||
super.readContainerData(buf);
|
||||
|
||||
progress = buf.readInt();
|
||||
duration = buf.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendContainerData(ByteBuf buf) {
|
||||
super.sendContainerData(buf);
|
||||
public void writeContainerData(ByteBuf buf) {
|
||||
super.writeContainerData(buf);
|
||||
|
||||
buf.writeInt(progress);
|
||||
buf.writeInt(recipe != null ? recipe.getDuration() : 0);
|
||||
|
||||
Reference in New Issue
Block a user