Examples of tagCount()


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

    NBTTagList rq = nbt.getTagList("rq",
        Constants.NBT.TAG_COMPOUND);

    ArrayList<ItemStack> rqs = new ArrayList<ItemStack>();

    for (int i = 0; i < rq.tagCount(); ++i) {
      try {
        NBTTagCompound sub = rq.getCompoundTagAt(i);

        if (sub.getInteger("id") >= 0) {
          // Maps the id in the blueprint to the id in the world
View Full Code Here

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

  public void read (NBTTagCompound nbt) {
    NBTTagList blocksMapping = nbt.getTagList("blocksMapping",
        Constants.NBT.TAG_COMPOUND);

    for (int i = 0; i < blocksMapping.tagCount(); ++i) {
      NBTTagCompound sub = blocksMapping.getCompoundTagAt(i);
      String name = sub.getString("name");
      Block b = (Block) Block.blockRegistry.getObject(name);
      registerBlock (b);
    }
View Full Code Here

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

    }

    NBTTagList itemsMapping = nbt.getTagList("itemsMapping",
        Constants.NBT.TAG_COMPOUND);

    for (int i = 0; i < itemsMapping.tagCount(); ++i) {
      NBTTagCompound sub = itemsMapping.getCompoundTagAt(i);
      String name = sub.getString("name");
      Item item = (Item) Item.itemRegistry.getObject(name);
      registerItem (item);
    }
View Full Code Here

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

    }

    NBTTagList entitiesMapping = nbt.getTagList("entitiesMapping",
        Constants.NBT.TAG_COMPOUND);

    for (int i = 0; i < entitiesMapping.tagCount(); ++i) {
      NBTTagCompound sub = entitiesMapping.getCompoundTagAt(i);
      String name = sub.getString("name");
      Class<? extends Entity> e = null;

      try {
View Full Code Here

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

    if (nbt.hasKey("rq")) {
      NBTTagList rq = nbt.getTagList("rq", Constants.NBT.TAG_COMPOUND);

      ArrayList<ItemStack> rqs = new ArrayList<ItemStack>();

      for (int i = 0; i < rq.tagCount(); ++i) {
        try {
          NBTTagCompound sub = rq.getCompoundTagAt(i);

          if (sub.getInteger("id") >= 0) {
            // Maps the id in the blueprint to the id in the world
View Full Code Here

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

    }

    NBTTagList list = nbt.getTagList(nbtName,
        Constants.NBT.TAG_COMPOUND);

    for (int i = 0; i < list.tagCount(); ++i) {
            NBTTagCompound invSlot = list.getCompoundTagAt(i);
            Item item = Item.getItemById(invSlot.getInteger ("id"));
            invSlot.setInteger("id", registry.getIdForItem(item));
    }
  }
View Full Code Here

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

    }

    NBTTagList list = nbt.getTagList(nbtName,
        Constants.NBT.TAG_COMPOUND);

    for (int i = 0; i < list.tagCount(); ++i) {
            NBTTagCompound invSlot = list.getCompoundTagAt(i);
            Item item = registry.getItemForId(invSlot.getInteger ("id"));
            invSlot.setInteger("id", Item.getIdFromItem(item));
    }
  }
View Full Code Here

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

    List<String> retVals = new ArrayList<String>();
    NBTTagCompound cmp = ItemNBTHelper.getNBT(par1ItemStack);
    if (!cmp.hasKey("research"))
      return retVals;
    NBTTagList list = cmp.getTagList("research", Constants.NBT.TAG_STRING);
    for (int i = 0; i < list.tagCount(); i++) {

      retVals.add(list.getStringTagAt(i));
    }
    return retVals;
  }
View Full Code Here

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

  @Override
  public ItemStack[] getInventory(ItemStack item) {
    ItemStack[] stackList = new ItemStack[13 * 9];
    if (item.hasTagCompound()) {
      NBTTagList var2 = item.stackTagCompound.getTagList("Inventory", Constants.NBT.TAG_COMPOUND);
      for (int var3 = 0; var3 < var2.tagCount(); var3++) {
        NBTTagCompound var4 = var2.getCompoundTagAt(var3);
        int var5 = var4.getByte("Slot") & 0xFF;
        if (var5 >= 0 && var5 < stackList.length)
          stackList[var5] = ItemStack.loadItemStackFromNBT(var4);
      }
View Full Code Here

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

    leftClick = par1NBTTagCompound.getBoolean(TAG_LEFT_CLICK);
    redstone = par1NBTTagCompound.getBoolean(TAG_REDSTONE);

    NBTTagList var2 = par1NBTTagCompound.getTagList("Items", Constants.NBT.TAG_COMPOUND);
    inventorySlots = new ItemStack[getSizeInventory()];
    for (int var3 = 0; var3 < var2.tagCount(); ++var3) {
      NBTTagCompound var4 = var2.getCompoundTagAt(var3);
      byte var5 = var4.getByte("Slot");
      if (var5 >= 0 && var5 < inventorySlots.length)
        inventorySlots[var5] = ItemStack.loadItemStackFromNBT(var4);
    }
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.