Examples of appendTag()


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

      if (inventory.slots.get(i) != null)
      {
        NBTTagCompound nbttagcompound1 = new NBTTagCompound();
        nbttagcompound1.setByte("Slot", (byte) i);
        inventory.slots.get(i).writeToNBT(nbttagcompound1);
        nbttaglist.appendTag(nbttagcompound1);
      }
    }
    nbt.setTag("Items", nbttaglist);
    if (getInventory().isInvNameLocalized())
    {
View Full Code Here

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

      if (slots.get(i) != null)
      {
        NBTTagCompound nbttagcompound = new NBTTagCompound();
        nbttagcompound.setByte("Slot", (byte) i);
        slots.get(i).writeToNBT(nbttagcompound);
        nbtList.appendTag(nbttagcompound);
      }
    }
    return nbtList;
  }
}
View Full Code Here

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

            if (chestContents[i] != null)
            {
                NBTTagCompound nbttagcompound1 = new NBTTagCompound();
                nbttagcompound1.setByte("Slot", (byte) i);
                chestContents[i].writeToNBT(nbttagcompound1);
                nbttaglist.appendTag(nbttagcompound1);
            }
        }

        nbttagcompound.setTag("Items", nbttaglist);
        nbttagcompound.setByte("facing", (byte)facing);
View Full Code Here

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

  public void writeToNBT(NBTTagCompound compound) {
    NBTTagList list = new NBTTagList();
    for( int i = 0; i < internalInv.length; i++ ) {
      if( internalInv[i] != null && internalInv[i].stackSize > 0 ) {
        NBTTagCompound tag = new NBTTagCompound();
        list.appendTag( tag );
        tag.setInteger( "index", i );
        internalInv[i].writeToNBT( tag );
      }
    }
    NBTTagCompound ownTag = new NBTTagCompound();
View Full Code Here

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

    // Write the ingredients.
    NBTTagList list1 = new NBTTagList();
    for( ItemStack stack : this ) {
      NBTTagCompound tag = new NBTTagCompound();
      Utils.writeItemStackToNBT( nbt, stack, "ingredient" );
      list1.appendTag( tag );
    }
    nbt.setTag( "ingredientList", list1 );

    // Write the recipes
    NBTTagList list2 = new NBTTagList();
View Full Code Here

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

    NBTTagList list2 = new NBTTagList();
    for( ItemsReference key : recipes.keySet() ) {
      NBTTagCompound tag = new NBTTagCompound();
      Utils.writeItemStackToNBT( nbt, key.toItemStack(), "key" );
      recipes.get( key ).writeToNBT( tag );
      list2.appendTag( tag );
    }
    nbt.setTag( "recipes", list2 );

    compound.setTag( "projectList", nbt );
  }
View Full Code Here

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

    for( i = 0; i < ingredients.length; i++ ) {
      NBTTagCompound tag = new NBTTagCompound();
      if( ingredients[i] != null ) {
        tag.setInteger( "index", i );
        ingredients[i].writeToNBT( tag );
        listIngredients.appendTag( tag );
      }
    }

    // Actual encoding
    NBTTagCompound recipeCompound = new NBTTagCompound( "encodedRecipe" );
View Full Code Here

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

    NBTTagList inputItems = new NBTTagList();
    for (MachineRecipeInput ri : inputs) {
      stackRoot = new NBTTagCompound();
      ri.writeToNbt(stackRoot);
      inputItems.appendTag(stackRoot);
    }

    nbtRoot.setTag(KEY_INPUT_STACKS, inputItems);

    nbtRoot.setString(KEY_RECIPE, recipe.getUid());
View Full Code Here

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

        cartList.appendTag(entityList);
        for (Entity entity : entsInCart) {
          NBTTagCompound entRoot = new NBTTagCompound();
          entRoot.setString("id", EntityList.getEntityString(entity));
          entity.writeToNBT(entRoot);
          entityList.appendTag(entRoot);
        }
      }
    }
    root.setTag("cartList", cartList);
View Full Code Here

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

    root.setTag("cartList", cartList);

    if(!newlySpawnedCarts.isEmpty()) {
      NBTTagList spawnedCartList = new NBTTagList();
      for (UUID uuid : newlySpawnedCarts) {
        spawnedCartList.appendTag(new NBTTagString(uuid.toString()));
      }
      root.setTag("newlySpawnedCarts", spawnedCartList);
    }
  }
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.