Search in sources :

Example 16 with NBTTagList

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

the class LogisticsSecurityTileEntity method handleListPacket.

public void handleListPacket(NBTTagCompound tag) {
    excludedCC.clear();
    NBTTagList list = tag.getTagList("list", 3);
    while (list.tagCount() > 0) {
        NBTBase base = list.removeTag(0);
        excludedCC.add(((NBTTagInt) base).func_150287_d());
    }
}
Also used : NBTTagList(net.minecraft.nbt.NBTTagList) NBTBase(net.minecraft.nbt.NBTBase)

Example 17 with NBTTagList

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

the class TileSortingMachine method writeToNBT.

@Override
public void writeToNBT(NBTTagCompound tag) {
    super.writeToNBT(tag);
    tag.setByte("pullMode", (byte) pullMode.ordinal());
    tag.setByte("sortMode", (byte) sortMode.ordinal());
    tag.setInteger("savedPulses", savedPulses);
    int[] colorArray = new int[colors.length];
    for (int i = 0; i < colorArray.length; i++) {
        colorArray[i] = colors[i].ordinal();
    }
    tag.setIntArray("colors", colorArray);
    tag.setIntArray("fuzzySettings", fuzzySettings);
    NBTTagList tagList = new NBTTagList();
    for (int currentIndex = 0; currentIndex < inventory.length; ++currentIndex) {
        if (inventory[currentIndex] != null) {
            NBTTagCompound tagCompound = new NBTTagCompound();
            tagCompound.setByte("Slot", (byte) currentIndex);
            inventory[currentIndex].writeToNBT(tagCompound);
            tagList.appendTag(tagCompound);
        }
    }
    tag.setTag("Items", tagList);
}
Also used : NBTTagList(net.minecraft.nbt.NBTTagList) NBTTagCompound(net.minecraft.nbt.NBTTagCompound)

Example 18 with NBTTagList

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

the class TileCircuitTable method writeToNBT.

@Override
public void writeToNBT(NBTTagCompound tag) {
    super.writeToNBT(tag);
    NBTTagList tagList = new NBTTagList();
    for (int currentIndex = 0; currentIndex < inventory.length; ++currentIndex) {
        if (inventory[currentIndex] != null) {
            NBTTagCompound tagCompound = new NBTTagCompound();
            tagCompound.setByte("Slot", (byte) currentIndex);
            inventory[currentIndex].writeToNBT(tagCompound);
            tagList.appendTag(tagCompound);
        }
    }
    tag.setTag("Items", tagList);
    tag.setString("textboxString", textboxString);
}
Also used : NBTTagList(net.minecraft.nbt.NBTTagList) NBTTagCompound(net.minecraft.nbt.NBTTagCompound)

Example 19 with NBTTagList

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

the class TileRegulator method writeToNBT.

@Override
public void writeToNBT(NBTTagCompound tag) {
    super.writeToNBT(tag);
    tag.setByte("filterColor", (byte) color.ordinal());
    tag.setByte("mode", (byte) mode);
    tag.setByte("fuzzySetting", (byte) fuzzySetting);
    NBTTagList tagList = new NBTTagList();
    for (int currentIndex = 0; currentIndex < inventory.length; ++currentIndex) {
        if (inventory[currentIndex] != null) {
            NBTTagCompound tagCompound = new NBTTagCompound();
            tagCompound.setByte("Slot", (byte) currentIndex);
            inventory[currentIndex].writeToNBT(tagCompound);
            tagList.appendTag(tagCompound);
        }
    }
    tag.setTag("Items", tagList);
}
Also used : NBTTagList(net.minecraft.nbt.NBTTagList) NBTTagCompound(net.minecraft.nbt.NBTTagCompound)

Example 20 with NBTTagList

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

the class TileProjectTable method writeToNBT.

@Override
public void writeToNBT(NBTTagCompound tag) {
    super.writeToNBT(tag);
    NBTTagList tagList = new NBTTagList();
    for (int currentIndex = 0; currentIndex < inventory.length; ++currentIndex) {
        if (inventory[currentIndex] != null) {
            NBTTagCompound tagCompound = new NBTTagCompound();
            tagCompound.setByte("Slot", (byte) currentIndex);
            inventory[currentIndex].writeToNBT(tagCompound);
            tagList.appendTag(tagCompound);
        }
    }
    tag.setTag("Items", tagList);
    tagList = new NBTTagList();
    for (int currentIndex = 0; currentIndex < craftingGrid.length; ++currentIndex) {
        if (craftingGrid[currentIndex] != null) {
            NBTTagCompound tagCompound = new NBTTagCompound();
            tagCompound.setByte("Slot", (byte) currentIndex);
            craftingGrid[currentIndex].writeToNBT(tagCompound);
            tagList.appendTag(tagCompound);
        }
    }
    tag.setTag("CraftingGrid", tagList);
}
Also used : NBTTagList(net.minecraft.nbt.NBTTagList) 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