Search in sources :

Example 46 with NBTTagCompound

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

the class ModuleApiaristSink method readFromNBT.

@Override
public void readFromNBT(NBTTagCompound nbttagcompound) {
    NBTTagCompound filters = nbttagcompound.getCompoundTag("filters");
    for (int i = 0; i < filter.length; i++) {
        NBTTagCompound filterNBT = filters.getCompoundTag("" + i);
        filter[i].readFromNBT(filterNBT);
    }
}
Also used : NBTTagCompound(net.minecraft.nbt.NBTTagCompound)

Example 47 with NBTTagCompound

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

the class ModuleApiaristSink method writeToNBT.

@Override
public void writeToNBT(NBTTagCompound nbttagcompound) {
    NBTTagCompound filters = new NBTTagCompound();
    for (int i = 0; i < filter.length; i++) {
        NBTTagCompound filterNBT = new NBTTagCompound();
        filter[i].writeToNBT(filterNBT);
        filters.setTag("" + i, filterNBT);
    }
    nbttagcompound.setTag("filters", filters);
}
Also used : NBTTagCompound(net.minecraft.nbt.NBTTagCompound)

Example 48 with NBTTagCompound

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

the class ModuleThaumicAspectSink method startWatching.

@Override
public void startWatching(EntityPlayer player) {
    localModeWatchers.add(player);
    NBTTagCompound nbt = new NBTTagCompound();
    writeToNBT(nbt);
    MainProxy.sendPacketToPlayer(PacketHandler.getPacket(ThaumicAspectsSinkList.class).setTag(nbt).setModulePos(this), player);
}
Also used : ThaumicAspectsSinkList(logisticspipes.network.packets.module.ThaumicAspectsSinkList) NBTTagCompound(net.minecraft.nbt.NBTTagCompound)

Example 49 with NBTTagCompound

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

the class ModuleThaumicAspectSink method aspectListChanged.

public void aspectListChanged() {
    if (MainProxy.isServer(_world.getWorld())) {
        NBTTagCompound nbt = new NBTTagCompound();
        writeToNBT(nbt);
        MainProxy.sendToPlayerList(PacketHandler.getPacket(ThaumicAspectsSinkList.class).setTag(nbt).setModulePos(this), localModeWatchers);
    } else {
        NBTTagCompound nbt = new NBTTagCompound();
        writeToNBT(nbt);
        MainProxy.sendPacketToServer(PacketHandler.getPacket(ThaumicAspectsSinkList.class).setTag(nbt).setModulePos(this));
    }
}
Also used : ThaumicAspectsSinkList(logisticspipes.network.packets.module.ThaumicAspectsSinkList) NBTTagCompound(net.minecraft.nbt.NBTTagCompound)

Example 50 with NBTTagCompound

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

the class LPBCTileGenericPipe method readFromNBT_LP.

@Override
public void readFromNBT_LP(NBTTagCompound nbt) {
    if (!nbt.hasKey("BC_Pipe_NBT")) {
        redstoneInput = 0;
        for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) {
            final String key = "redstoneInputSide[" + i + "]";
            if (nbt.hasKey(key)) {
                redstoneInputSide[i] = nbt.getByte(key);
                if (redstoneInputSide[i] > redstoneInput) {
                    redstoneInput = redstoneInputSide[i];
                }
            } else {
                redstoneInputSide[i] = 0;
            }
        }
        //Import PipePart
        pipe.readFromNBT(nbt);
        //Import TilePart
        pipeBound = true;
        sideProperties.readFromNBT(nbt);
        attachPluggables = true;
        return;
    }
    NBTTagCompound bcNBT = nbt.getCompoundTag("BC_Pipe_NBT");
    redstoneInput = 0;
    for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) {
        final String key = "redstoneInputSide[" + i + "]";
        if (bcNBT.hasKey(key)) {
            redstoneInputSide[i] = bcNBT.getByte(key);
            if (redstoneInputSide[i] > redstoneInput) {
                redstoneInput = redstoneInputSide[i];
            }
        } else {
            redstoneInputSide[i] = 0;
        }
    }
    pipeBound = true;
    pipe.readFromNBT(bcNBT);
    sideProperties.readFromNBT(bcNBT);
    attachPluggables = true;
}
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