Search in sources :

Example 21 with NBTTagCompound

use of net.minecraft.nbt.NBTTagCompound in project BluePower by Qmunity.

the class GateIntegratedCircuit method readFromNBT.

@Override
public void readFromNBT(NBTTagCompound tag) {
    super.readFromNBT(tag);
    NBTTagList l = tag.getTagList("parts", new NBTTagCompound().getId());
    readParts(l);
}
Also used : NBTTagList(net.minecraft.nbt.NBTTagList) NBTTagCompound(net.minecraft.nbt.NBTTagCompound)

Example 22 with NBTTagCompound

use of net.minecraft.nbt.NBTTagCompound in project BluePower by Qmunity.

the class TileMachineBase method writeToNBT.

@Override
public void writeToNBT(NBTTagCompound compound) {
    super.writeToNBT(compound);
    NBTTagList nbttaglist = new NBTTagList();
    for (TubeStack tubeStack : internalItemStackBuffer) {
        if (tubeStack != null) {
            NBTTagCompound nbttagcompound1 = new NBTTagCompound();
            tubeStack.writeToNBT(nbttagcompound1);
            nbttaglist.appendTag(nbttagcompound1);
        }
    }
    compound.setTag("ItemBuffer", nbttaglist);
}
Also used : NBTTagList(net.minecraft.nbt.NBTTagList) TubeStack(com.bluepowermod.part.tube.TubeStack) NBTTagCompound(net.minecraft.nbt.NBTTagCompound)

Example 23 with NBTTagCompound

use of net.minecraft.nbt.NBTTagCompound in project BluePower by Qmunity.

the class TileAlloyFurnace method readFromNBT.

/*************** BASIC TE FUNCTIONS **************/
/**
     * This function gets called whenever the world/chunk loads
     */
@Override
public void readFromNBT(NBTTagCompound tCompound) {
    super.readFromNBT(tCompound);
    for (int i = 0; i < 9; i++) {
        NBTTagCompound tc = tCompound.getCompoundTag("inventory" + i);
        inventory[i] = ItemStack.loadItemStackFromNBT(tc);
    }
    fuelInventory = ItemStack.loadItemStackFromNBT(tCompound.getCompoundTag("fuelInventory"));
    outputInventory = ItemStack.loadItemStackFromNBT(tCompound.getCompoundTag("outputInventory"));
}
Also used : NBTTagCompound(net.minecraft.nbt.NBTTagCompound)

Example 24 with NBTTagCompound

use of net.minecraft.nbt.NBTTagCompound in project BluePower by Qmunity.

the class TileBuffer method readFromNBT.

/**
     * This function gets called whenever the world/chunk loads
     */
@Override
public void readFromNBT(NBTTagCompound tCompound) {
    super.readFromNBT(tCompound);
    for (int i = 0; i < 20; i++) {
        NBTTagCompound tc = tCompound.getCompoundTag("inventory" + i);
        allInventories[i] = ItemStack.loadItemStackFromNBT(tc);
    }
}
Also used : NBTTagCompound(net.minecraft.nbt.NBTTagCompound)

Example 25 with NBTTagCompound

use of net.minecraft.nbt.NBTTagCompound in project BluePower by Qmunity.

the class TileDeployer method readFromNBT.

/**
     * This function gets called whenever the world/chunk loads
     */
@Override
public void readFromNBT(NBTTagCompound tCompound) {
    super.readFromNBT(tCompound);
    for (int i = 0; i < 9; i++) {
        NBTTagCompound tc = tCompound.getCompoundTag("inventory" + i);
        inventory[i] = ItemStack.loadItemStackFromNBT(tc);
    }
}
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