Package net.minecraft.nbt

Examples of net.minecraft.nbt.NBTTagList.tagCount()


    if(!nbtRoot.hasKey(key)) {
      return;
    }
    NBTTagList tags = (NBTTagList) nbtRoot.getTag(key);
    for (int i = 0; i < tags.tagCount(); i++) {
      NBTTagCompound chanelTag = tags.getCompoundTagAt(i);
      Channel channel = Channel.readFromNBT(chanelTag);
      if(channel != null) {
        readInto.get(channel.getType()).add(channel);
      }
View Full Code Here


    if(!root.hasKey("fluidFilter")) {
      clear();
      return;
    }
    NBTTagList fluidList = (NBTTagList) root.getTag("fluidFilter");
    for (int i = 0; i < fluidList.tagCount(); i++) {
      NBTTagCompound fRoot = fluidList.getCompoundTagAt(i);
      setFluid(fRoot.getInteger("index"), fRoot.getString("fluidName"));
    }
  }
View Full Code Here

  public void readFromNBT(NBTTagCompound nbtRoot, short nbtVersion) {
    super.readFromNBT(nbtRoot, nbtVersion);
    if(nbtRoot.hasKey("validConnections")) {
      validConnections.clear();
      NBTTagList connections = nbtRoot.getTagList("validConnections", Constants.NBT.TAG_STRING);
      for (int i = 0; i < connections.tagCount(); i++) {
        validConnections.add(ForgeDirection.valueOf(connections.getStringTagAt(i)));
      }
    }
  }
View Full Code Here

    sticky = nbtRoot.getBoolean("sticky");
   
    if(nbtRoot.hasKey("snapshot")) {
      snapshot = new ArrayList<ItemStack>();
      NBTTagList itemList = (NBTTagList)nbtRoot.getTag("snapshot");
      for(int i=0;i<itemList.tagCount();i++) {
        NBTTagCompound itemTag = itemList.getCompoundTagAt(i);
        ItemStack itemStack = ItemStack.loadItemStackFromNBT(itemTag);
        if(itemStack != null) {
          snapshot.add(itemStack);
        }
View Full Code Here

    super.readFromNBT(nbttagcompound);

    NBTTagList nbtTagList = nbttagcompound.getTagList("Items");
    this.inventory = new ItemStack[this.getSizeInventory()];

    for (int i = 0; i < nbtTagList.tagCount(); i++)
    {
      NBTTagCompound nbttagcompound1 = (NBTTagCompound) nbtTagList.tagAt(i);

      byte byte0 = nbttagcompound1.getByte("Slot");
      if ((byte0 >= 0) && (byte0 < this.inventory.length))
View Full Code Here

    short nbtVersion = nbtRoot.getShort("nbtVersion");

    conduits.clear();
    NBTTagList conduitTags = (NBTTagList) nbtRoot.getTag("conduits");
    if(conduitTags != null) {
      for (int i = 0; i < conduitTags.tagCount(); i++) {
        NBTTagCompound conduitTag = conduitTags.getCompoundTagAt(i);
        IConduit conduit = ConduitUtil.readConduitFromNBT(conduitTag, nbtVersion);
        if(conduit != null) {
          conduit.setBundle(this);
          conduits.add(conduit);
View Full Code Here

    if(nbtTags.hasKey("filters"))
    {
      NBTTagList tagList = nbtTags.getTagList("filters", NBT.TAG_COMPOUND);

      for(int i = 0; i < tagList.tagCount(); i++)
      {
        filters.add(MinerFilter.readFromNBT((NBTTagCompound)tagList.getCompoundTagAt(i)));
      }
    }
  }
View Full Code Here

    for(MinerFilter filter : filters)
    {
      filterTags.appendTag(filter.write(new NBTTagCompound()));
    }

    if(filterTags.tagCount() != 0)
    {
      nbtTags.setTag("filters", filterTags);
    }
  }
View Full Code Here

    for(MinerFilter filter : filters)
    {
      filterTags.appendTag(filter.write(new NBTTagCompound()));
    }

    if(filterTags.tagCount() != 0)
    {
      nbtTags.setTag("filters", filterTags);
    }
   
    return nbtTags;
View Full Code Here

    if(nbtTags.hasKey("filters"))
    {
      NBTTagList tagList = nbtTags.getTagList("filters", NBT.TAG_COMPOUND);

      for(int i = 0; i < tagList.tagCount(); i++)
      {
        filters.add(MinerFilter.readFromNBT((NBTTagCompound)tagList.getCompoundTagAt(i)));
      }
    }
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.