Search in sources :

Example 16 with NBTTagCompound

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;
}
Also used : NBTTagCompound(net.minecraft.nbt.NBTTagCompound) ItemStack(net.minecraft.item.ItemStack)

Example 17 with NBTTagCompound

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);
}
Also used : NBTTagCompound(net.minecraft.nbt.NBTTagCompound)

Example 18 with NBTTagCompound

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);
}
Also used : NBTTagCompound(net.minecraft.nbt.NBTTagCompound)

Example 19 with NBTTagCompound

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);
}
Also used : NBTTagList(net.minecraft.nbt.NBTTagList) MessageRedirectTubeStack(com.bluepowermod.network.message.MessageRedirectTubeStack) NBTTagCompound(net.minecraft.nbt.NBTTagCompound)

Example 20 with NBTTagCompound

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);
}
Also used : NBTTagCompound(net.minecraft.nbt.NBTTagCompound)

Aggregations

NBTTagCompound (net.minecraft.nbt.NBTTagCompound)3985 NBTTagList (net.minecraft.nbt.NBTTagList)1052 ItemStack (net.minecraft.item.ItemStack)883 BlockPos (net.minecraft.util.math.BlockPos)229 TileEntity (net.minecraft.tileentity.TileEntity)173 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)148 ArrayList (java.util.ArrayList)99 Block (net.minecraft.block.Block)98 ResourceLocation (net.minecraft.util.ResourceLocation)96 IBlockState (net.minecraft.block.state.IBlockState)92 EntityPlayer (net.minecraft.entity.player.EntityPlayer)81 NBTTagString (net.minecraft.nbt.NBTTagString)79 Nonnull (javax.annotation.Nonnull)74 Map (java.util.Map)71 UUID (java.util.UUID)69 NBTBase (net.minecraft.nbt.NBTBase)66 HashMap (java.util.HashMap)64 EnumFacing (net.minecraft.util.EnumFacing)61 NotNull (org.jetbrains.annotations.NotNull)60 Item (net.minecraft.item.Item)55