Package net.minecraft.nbt

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


                        {
                          Vector3 vector = new Vector3((NBTTagCompound) list.tagAt(i));

                          if (vector.equals(position))
                          {
                            list.removeTag(i);
                          }
                        }
                      }
                    }
                  }
View Full Code Here


        NBTTagList nbttaglist = stack.getEnchantmentTagList();
        if (nbttaglist != null) {
            for (int i = 0; i < nbttaglist.tagCount(); i++) {
                int ID = nbttaglist.getCompoundTagAt(i).getShort("id");
                if (ID == e) {
                    nbttaglist.removeTag(i);
                    if (nbttaglist.tagCount() == 0)
                        stack.getTagCompound().removeTag("ench");
                    if (stack.getTagCompound().hasNoTags())
                        stack.setTagCompound(null);
                    return;
View Full Code Here

        if (list.func_150303_d() == Constants.NBT.TAG_COMPOUND) {
          for (int i = list.tagCount() - 1; i >= 0; --i) {
            try {
              scanAndTranslateStacksToWorld(list.getCompoundTagAt(i));
            } catch (MappingNotFoundException e) {
              list.removeTag(i);
            }
          }
        }
      }
    }
View Full Code Here

                    for (int j = 0; j < list.tagCount(); ++j)
                    {
                        if (list.getCompoundTagAt(j).getString("FEbinding").startsWith(color + args[0].toLowerCase()))
                        {
                            System.out.println("Match found");
                            list.removeTag(j);
                        }
                    }
                }
                list.appendTag(new NBTTagString(color + args[0].toLowerCase() + "> " + cmd));
                display.setTag("Lore", list);
View Full Code Here

      for (int i = 0; i < list.tagCount(); i++) {
        NBTTagCompound compound = list.getCompoundTagAt(i);
        if (compound.getShort("id") != BetterStorageEnchantment.get("lockpicking").effectId) continue;
        int level = compound.getShort("lvl") - 1;
        if (level == 0) {
          list.removeTag(i);
          if (list.tagCount() == 0)
            key.getTagCompound().removeTag("ench");
        } else compound.setShort("lvl", (short)level);
        break;
      }
View Full Code Here

      key.setItemDamage(lockId);
      NBTTagList list = key.getEnchantmentTagList();
      for (int i = 0; i < list.tagCount(); i++) {
        NBTTagCompound compound = list.getCompoundTagAt(i);
        if (compound.getShort("id") != BetterStorageEnchantment.get("morphing").effectId) continue;
        list.removeTag(i);
        // Morphed keys keep their enchanted look, it looks sweet.
        // if (list.tagCount() == 0)
        //  key.getTagCompound().removeTag("ench");
      }
      return true;
View Full Code Here

        {
            NBTTagList list = tag.getTagList(name, new NBTTagLong(0).getId());
            long[] array = new long[list.tagCount()];
            for (int i = 0; i < array.length; i++)
            {
                array[i] = ((NBTTagLong) list.removeTag(0)).func_150291_c();
            }

            return array;
        }
        else if (type.equals(boolean.class))
View Full Code Here

        {
            NBTTagList list = tag.getTagList(name, new NBTTagByte((byte) 0).getId());
            boolean[] array = new boolean[list.tagCount()];
            for (int i = 0; i < array.length; i++)
            {
                array[i] = ((NBTTagByte) list.removeTag(0)).func_150290_f() != 0;
            }

            return array;
        }
        else if (type.equals(String.class))
View Full Code Here

    allowAutoDestroy = par1nbtTagCompound.getBoolean("allowAutoDestroy");
    inv.readFromNBT(par1nbtTagCompound);
    settingsList.clear();
    NBTTagList list = par1nbtTagCompound.getTagList("settings", 10);
    while(list.tagCount() > 0) {
      NBTBase base = list.removeTag(0);
      String name = ((NBTTagCompound)base).getString("name");
      NBTTagCompound value = ((NBTTagCompound)base).getCompoundTag("content");
      SecuritySettings settings = new SecuritySettings(name);
      settings.readFromNBT(value);
      settingsList.put(name, settings);
View Full Code Here

      settingsList.put(name, settings);
    }
    excludedCC.clear();
    list = par1nbtTagCompound.getTagList("excludedCC", 3);
    while(list.tagCount() > 0) {
      NBTBase base = list.removeTag(0);
      excludedCC.add(((NBTTagInt)base).func_150287_d());
    }
  }

  @Override
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.