Search in sources :

Example 11 with NBTTagList

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

the class GateIntegratedCircuit method writeToNBT.

// NBT and update packets
@Override
public void writeToNBT(NBTTagCompound tag) {
    super.writeToNBT(tag);
    NBTTagList l = new NBTTagList();
    writeParts(l);
    tag.setTag("parts", l);
}
Also used : NBTTagList(net.minecraft.nbt.NBTTagList)

Example 12 with NBTTagList

use of net.minecraft.nbt.NBTTagList 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 13 with NBTTagList

use of net.minecraft.nbt.NBTTagList 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 14 with NBTTagList

use of net.minecraft.nbt.NBTTagList 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 15 with NBTTagList

use of net.minecraft.nbt.NBTTagList in project LogisticsPipes by RS485.

the class LogisticsSecurityTileEntity method requestList.

public void requestList(EntityPlayer player) {
    NBTTagCompound tag = new NBTTagCompound();
    NBTTagList list = new NBTTagList();
    for (Integer i : excludedCC) {
        list.appendTag(new NBTTagInt(i));
    }
    tag.setTag("list", list);
    MainProxy.sendPacketToPlayer(PacketHandler.getPacket(SecurityStationCCIDs.class).setTag(tag).setPosX(xCoord).setPosY(yCoord).setPosZ(zCoord), player);
}
Also used : NBTTagList(net.minecraft.nbt.NBTTagList) NBTTagInt(net.minecraft.nbt.NBTTagInt) SecurityStationCCIDs(logisticspipes.network.packets.block.SecurityStationCCIDs) NBTTagCompound(net.minecraft.nbt.NBTTagCompound)

Aggregations

NBTTagList (net.minecraft.nbt.NBTTagList)451 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)385 ItemStack (net.minecraft.item.ItemStack)69 NBTTagString (net.minecraft.nbt.NBTTagString)42 BlockPos (net.minecraft.util.math.BlockPos)18 HashMap (java.util.HashMap)17 Map (java.util.Map)17 NotNull (org.jetbrains.annotations.NotNull)17 ArrayList (java.util.ArrayList)14 AMVector3 (am2.api.math.AMVector3)9 ChunkPosition (net.minecraft.world.ChunkPosition)9 NBTBase (net.minecraft.nbt.NBTBase)8 EntityPlayer (net.minecraft.entity.player.EntityPlayer)7 Vec3d (net.minecraft.util.math.Vec3d)7 WorldCoordinate (mods.railcraft.api.core.WorldCoordinate)6 Block (net.minecraft.block.Block)6 ItemIdentifierStack (logisticspipes.utils.item.ItemIdentifierStack)5 Entity (net.minecraft.entity.Entity)5 TileEntity (net.minecraft.tileentity.TileEntity)5 ChunkPos (net.minecraft.util.math.ChunkPos)5