Package net.minecraft.src

Examples of net.minecraft.src.NBTTagList


    }
  }
   public void readFromNBT(NBTTagCompound nbttagcompound) {
       super.readFromNBT(nbttagcompound);
      
       NBTTagList nbttaglist = nbttagcompound.getTagList("stackList");
      
       theInventory = new ItemStack [nbttaglist.tagCount()];
      
       for (int i = 0; i < theInventory.length; ++i) { 
         NBTTagCompound nbttagcompound2 = (NBTTagCompound) nbttaglist
        .tagAt(i)
        
         if (!nbttagcompound2.getBoolean("isNull")) {
           theInventory [i] = ItemStack.loadItemStackFromNBT(nbttagcompound2);
         }
View Full Code Here


   }

  public void writeToNBT(NBTTagCompound nbttagcompound) {
    super.writeToNBT(nbttagcompound);
   
      NBTTagList nbttaglist = new NBTTagList();
     
      for (int i = 0; i < theInventory.length; ++i) {       
        NBTTagCompound nbttagcompound2 = new NBTTagCompound ();
        nbttaglist.appendTag(nbttagcompound2);
        if (theInventory[i] == null) {
          nbttagcompound2.setBoolean("isNull", true);
        } else {
          nbttagcompound2.setBoolean("isNull", false);
          theInventory[i].writeToNBT(nbttagcompound2);
View Full Code Here

      }
      if (!itemstack.stackTagCompound.hasKey("display")) {
        itemstack.stackTagCompound.setCompoundTag("display", new NBTTagCompound());
      }

      NBTTagList loreTagList = new NBTTagList();

      for (String l : getLore()) {
        loreTagList.appendTag(new NBTTagString(l));
      }

      itemstack.stackTagCompound.getCompoundTag("display").setTag("Lore", loreTagList);
    }
View Full Code Here

TOP

Related Classes of net.minecraft.src.NBTTagList

Copyright © 2018 www.massapicom. 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.