use of net.minecraft.nbt.NBTTagCompound in project LogisticsPipes by RS485.
the class ModuleApiaristSink method readFromNBT.
@Override
public void readFromNBT(NBTTagCompound nbttagcompound) {
NBTTagCompound filters = nbttagcompound.getCompoundTag("filters");
for (int i = 0; i < filter.length; i++) {
NBTTagCompound filterNBT = filters.getCompoundTag("" + i);
filter[i].readFromNBT(filterNBT);
}
}
use of net.minecraft.nbt.NBTTagCompound in project LogisticsPipes by RS485.
the class ModuleApiaristSink method writeToNBT.
@Override
public void writeToNBT(NBTTagCompound nbttagcompound) {
NBTTagCompound filters = new NBTTagCompound();
for (int i = 0; i < filter.length; i++) {
NBTTagCompound filterNBT = new NBTTagCompound();
filter[i].writeToNBT(filterNBT);
filters.setTag("" + i, filterNBT);
}
nbttagcompound.setTag("filters", filters);
}
use of net.minecraft.nbt.NBTTagCompound in project LogisticsPipes by RS485.
the class ModuleThaumicAspectSink method startWatching.
@Override
public void startWatching(EntityPlayer player) {
localModeWatchers.add(player);
NBTTagCompound nbt = new NBTTagCompound();
writeToNBT(nbt);
MainProxy.sendPacketToPlayer(PacketHandler.getPacket(ThaumicAspectsSinkList.class).setTag(nbt).setModulePos(this), player);
}
use of net.minecraft.nbt.NBTTagCompound in project LogisticsPipes by RS485.
the class ModuleThaumicAspectSink method aspectListChanged.
public void aspectListChanged() {
if (MainProxy.isServer(_world.getWorld())) {
NBTTagCompound nbt = new NBTTagCompound();
writeToNBT(nbt);
MainProxy.sendToPlayerList(PacketHandler.getPacket(ThaumicAspectsSinkList.class).setTag(nbt).setModulePos(this), localModeWatchers);
} else {
NBTTagCompound nbt = new NBTTagCompound();
writeToNBT(nbt);
MainProxy.sendPacketToServer(PacketHandler.getPacket(ThaumicAspectsSinkList.class).setTag(nbt).setModulePos(this));
}
}
use of net.minecraft.nbt.NBTTagCompound in project LogisticsPipes by RS485.
the class LPBCTileGenericPipe method readFromNBT_LP.
@Override
public void readFromNBT_LP(NBTTagCompound nbt) {
if (!nbt.hasKey("BC_Pipe_NBT")) {
redstoneInput = 0;
for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) {
final String key = "redstoneInputSide[" + i + "]";
if (nbt.hasKey(key)) {
redstoneInputSide[i] = nbt.getByte(key);
if (redstoneInputSide[i] > redstoneInput) {
redstoneInput = redstoneInputSide[i];
}
} else {
redstoneInputSide[i] = 0;
}
}
//Import PipePart
pipe.readFromNBT(nbt);
//Import TilePart
pipeBound = true;
sideProperties.readFromNBT(nbt);
attachPluggables = true;
return;
}
NBTTagCompound bcNBT = nbt.getCompoundTag("BC_Pipe_NBT");
redstoneInput = 0;
for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) {
final String key = "redstoneInputSide[" + i + "]";
if (bcNBT.hasKey(key)) {
redstoneInputSide[i] = bcNBT.getByte(key);
if (redstoneInputSide[i] > redstoneInput) {
redstoneInput = redstoneInputSide[i];
}
} else {
redstoneInputSide[i] = 0;
}
}
pipeBound = true;
pipe.readFromNBT(bcNBT);
sideProperties.readFromNBT(bcNBT);
attachPluggables = true;
}
Aggregations