Examples of tagCount()


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

      NBTTagCompound nbtRoot = accessor.getNBTData();
      short nbtVersion = nbtRoot.getShort("nbtVersion");
      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 instanceof IPowerConduit) {
            currenttip.add(String.format("%s%s%s / %s%s%s RF", EnumChatFormatting.WHITE, fmt.format(((IPowerConduit) conduit).getEnergyStored()), EnumChatFormatting.RESET,
                EnumChatFormatting.WHITE, fmt.format(((IConduitBundle) te).getMaxEnergyStored()), EnumChatFormatting.RESET));
View Full Code Here

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

    if(inputItems == null) {
      return null;
    }

    List<MachineRecipeInput> ins = new ArrayList<MachineRecipeInput>(3);
    for (int i = 0; i < inputItems.tagCount(); i++) {
      NBTTagCompound stackTag = inputItems.getCompoundTagAt(i);
      MachineRecipeInput mi = MachineRecipeInput.readFromNBT(stackTag);
      ins.add(mi);
    }
View Full Code Here

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

  private void loadCartsToSpawn() {
    World worldObj = transciever.getWorldObj();
    while (cartList.tagCount() > 0) {
      NBTTagList entityList = (NBTTagList) cartList.removeTag(0);
      List<Entity> ents = new ArrayList<Entity>(entityList.tagCount());
      for (int i = 0; i < entityList.tagCount(); i++) {
        NBTTagCompound entityRoot = entityList.getCompoundTagAt(i);
        Entity entity = EntityList.createEntityFromNBT(entityRoot, worldObj);
        if(entity != null) {
          ents.add(entity);
View Full Code Here

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

  private void loadCartsToSpawn() {
    World worldObj = transciever.getWorldObj();
    while (cartList.tagCount() > 0) {
      NBTTagList entityList = (NBTTagList) cartList.removeTag(0);
      List<Entity> ents = new ArrayList<Entity>(entityList.tagCount());
      for (int i = 0; i < entityList.tagCount(); i++) {
        NBTTagCompound entityRoot = entityList.getCompoundTagAt(i);
        Entity entity = EntityList.createEntityFromNBT(entityRoot, worldObj);
        if(entity != null) {
          ents.add(entity);
        }
View Full Code Here

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

    cartList = (NBTTagList) root.getTag("cartList");

    newlySpawnedCarts.clear();
    if(root.hasKey("newlySpawnedCarts")) {
      NBTTagList spawnedCartList = (NBTTagList) root.getTag("newlySpawnedCarts");
      for (int i = 0; i < spawnedCartList.tagCount(); i++) {
        String uuisStr = spawnedCartList.getStringTagAt(i);
        newlySpawnedCarts.add(UUID.fromString(uuisStr));
      }
    }
  }
View Full Code Here

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

    for (int i = 0; i < inventory.length; i++) {
      inventory[i] = null;
    }

    NBTTagList itemList = (NBTTagList) nbtRoot.getTag("Items");
    for (int i = 0; i < itemList.tagCount(); i++) {
      NBTTagCompound itemStack = itemList.getCompoundTagAt(i);
      byte slot = itemStack.getByte("Slot");
      if(slot >= 0 && slot < inventory.length) {
        inventory[slot] = ItemStack.loadItemStackFromNBT(itemStack);
      }
View Full Code Here

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

      for (int i = 0; i < inv.length; i++) {
        inv[i] = null;
      }
      return;
    }
    for (int i = 0; i < itemList.tagCount(); i++) {
      NBTTagCompound itemStack = itemList.getCompoundTagAt(i);
      byte slot = itemStack.getByte("Slot");
      if(slot >= 0 && slot < inv.length) {
        inv[slot] = ItemStack.loadItemStackFromNBT(itemStack);
      }
View Full Code Here

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

  @Override
  public void fromBytes(ByteBuf buf) {
    NBTTagCompound root = NetworkUtil.readNBTTagCompound(buf);
    NBTTagList tagList = (NBTTagList)root.getTag("chanList");
    channels = new ArrayList<Channel>();
    for(int i=0; i < tagList.tagCount();i++) {
      NBTTagCompound tag = tagList.getCompoundTagAt(i);
      Channel chan = Channel.readFromNBT(tag);
      if(chan != null) {
        channels.add(chan);
      }
View Full Code Here

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

  }
 
  public void readContentsFromNBT(NBTTagCompound nbtRoot) {
    NBTTagList itemList = (NBTTagList) nbtRoot.getTag("Items");
    if(itemList != null) {
      for (int i = 0; i < itemList.tagCount(); i++) {
        NBTTagCompound itemStack = itemList.getCompoundTagAt(i);
        byte slot = itemStack.getByte("Slot");
        if(slot >= 0 && slot < inv.length) {
          inv[slot] = ItemStack.loadItemStackFromNBT(itemStack);
        }
View Full Code Here

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

  @Override
  protected void readCustomNBT(NBTTagCompound root) {
    NBTTagList itemList = (NBTTagList) root.getTag("Items");
    if(itemList != null) {
      for (int i = 0; i < itemList.tagCount(); i++) {
        NBTTagCompound itemStack = itemList.getCompoundTagAt(i);
        byte slot = itemStack.getByte("Slot");
        if(slot >= 0 && slot < inv.length) {
          inv[slot] = ItemStack.loadItemStackFromNBT(itemStack);
        }
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.