use of net.minecraft.nbt.NBTTagCompound in project BluePower by Qmunity.
the class GateNullCell method getStackWithData.
public static ItemStack getStackWithData(GateNullCell gate) {
ItemStack is = PartManager.getPartInfo("nullcell").getStack();
if (is.getTagCompound() == null)
is.setTagCompound(new NBTTagCompound());
NBTTagCompound tag = new NBTTagCompound();
gate.writeToNBT(tag);
is.getTagCompound().setTag("tileData", tag);
is.getTagCompound().setBoolean("hideSilkyTooltip", true);
return is;
}
use of net.minecraft.nbt.NBTTagCompound in project BluePower by Qmunity.
the class PneumaticTube method readFromNBT.
@Override
public void readFromNBT(NBTTagCompound tag) {
super.readFromNBT(tag);
int connectionCount = 0;
for (int i = 0; i < 6; i++) {
connections[i] = tag.getBoolean("connections" + i);
redstoneConnections[i] = tag.getBoolean("redstoneConnections" + i);
if (connections[i])
connectionCount++;
}
isCrossOver = connectionCount != 2;
for (int i = 0; i < color.length; i++) color[i] = TubeColor.values()[tag.getByte("tubeColor" + i)];
if (tag.hasKey("wireType"))
redwireType = RedwireType.values()[tag.getInteger("wireType")];
else
redwireType = null;
setRedstonePower(null, tag.getByte("power"));
if (getParent() != null && getWorld() != null)
getWorld().markBlockRangeForRenderUpdate(getX(), getY(), getZ(), getX(), getY(), getZ());
NBTTagCompound logicTag = tag.getCompoundTag("logic");
logic.readFromNBT(logicTag);
}
use of net.minecraft.nbt.NBTTagCompound in project BluePower by Qmunity.
the class TubeLogic method writeData.
public void writeData(DataOutput buffer) throws IOException {
NBTTagCompound tag = new NBTTagCompound();
writeToNBT(tag);
PacketHelper.writeNBT(buffer, tag);
}
use of net.minecraft.nbt.NBTTagCompound in project BluePower by Qmunity.
the class TubeLogic method writeToNBT.
public void writeToNBT(NBTTagCompound tag) {
NBTTagList tagList = new NBTTagList();
for (TubeStack stack : tubeStacks) {
NBTTagCompound stackTag = new NBTTagCompound();
stack.writeToNBT(stackTag);
tagList.appendTag(stackTag);
}
tag.setTag("tubeStacks", tagList);
tag.setInteger("roundRobinCounter", roundRobinCounter);
}
use of net.minecraft.nbt.NBTTagCompound in project BluePower by Qmunity.
the class TubeStack method copy.
public TubeStack copy() {
NBTTagCompound tag = new NBTTagCompound();
writeToNBT(tag);
return loadFromNBT(tag);
}
Aggregations