Package net.minecraft.src

Examples of net.minecraft.src.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


    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 (hasLore()) {
      if (itemstack.stackTagCompound == null) {
        itemstack.stackTagCompound = new NBTTagCompound();
      }
      if (!itemstack.stackTagCompound.hasKey("display")) {
        itemstack.stackTagCompound.setCompoundTag("display", new NBTTagCompound());
      }

      NBTTagList loreTagList = new NBTTagList();

      for (String l : getLore()) {
View Full Code Here

    *
    * @param key - The key to modify
    * @param value - The value to change
    */
   private void changeWorldInfo(String key, Object value) {
      NBTTagCompound nbt = world.getWorldInfo().getNBTTagCompound();
      if (value instanceof String) {
         nbt.setString(key, (String) value);
      } else if (value instanceof Boolean) {
         nbt.setBoolean(key, (Boolean) value);
      } else if (value instanceof Integer) {
         nbt.setInteger(key, (Integer) value);
      } else if (value instanceof Long) {
         nbt.setLong(key, (Long) value);
      }
      WorldInfo info = new WorldInfo(nbt);
      try {
         Field fields[] = net.minecraft.src.World.class.getDeclaredFields();
         for (Field field : fields) {
View Full Code Here

    this.citizens = new ArrayList<EntityLiving>();
    bounty = 0;
  }

  public void save(String location) throws IOException {
    NBTTagCompound nbt = new NBTTagCompound(name);
    nbt.setString("hold.name", name);
    nbt.setInteger("hold.faction", faction == Stormcloak.class ? 0 : 1);
    nbt.setInteger("hold.center.posX", center.x);
    nbt.setInteger("hold.center.posY", center.y);
    nbt.setInteger("hold.center.posZ", center.z);
    nbt.setInteger("hold.bounty", bounty);
    CompressedStreamTools.writeCompressed(nbt, new FileOutputStream(new File(location)));
  }
View Full Code Here

    nbt.setInteger("hold.bounty", bounty);
    CompressedStreamTools.writeCompressed(nbt, new FileOutputStream(new File(location)));
  }

  public static Hold load(String s) throws IOException {
    NBTTagCompound nbt = CompressedStreamTools.readCompressed(new FileInputStream(new File(s)));
    Hold h = new Hold("", 0, null);
    h.name = nbt.getString("hold.name");
    h.faction = (nbt.getInteger("hold.faction") == 0 ? Stormcloak.class
        : Imperial.class);
    h.center = new Location(nbt.getInteger("hold.center.posX"),
        nbt.getInteger("hold.center.posY"),
        nbt.getInteger("hold.center.posZ"));
    h.citizens = new ArrayList<EntityLiving>();
    h.bounty = nbt.getInteger("hold.bounty");
    return h;
  }
View Full Code Here

    liquidQty = nbttagcompound.getInteger("liquidQty");
    burnTime = nbttagcompound.getInteger("burnTime");
    heat = nbttagcompound.getInteger("heat");

    if (nbttagcompound.hasKey("itemInInventory")) {
      NBTTagCompound cpt = nbttagcompound.getCompoundTag("itemInInventory");
      itemInInventory = ItemStack.loadItemStackFromNBT(cpt);
    }

  }
View Full Code Here

    nbttagcompound.setInteger("liquidQty", liquidQty);
    nbttagcompound.setInteger("burnTime", burnTime);
    nbttagcompound.setInteger("heat", heat);
   
    if (itemInInventory != null) {
      NBTTagCompound cpt = new NBTTagCompound();
      itemInInventory.writeToNBT(cpt);
      nbttagcompound.setTag("itemInInventory", cpt);
    }

  }
View Full Code Here

    liquidQty = nbttagcompound.getInteger("liquidQty");
    burnTime = nbttagcompound.getInteger("burnTime");
    heat = nbttagcompound.getInteger("heat");

    if (nbttagcompound.hasKey("itemInInventory")) {
      NBTTagCompound cpt = nbttagcompound.getCompoundTag("itemInInventory");
      itemInInventory = ItemStack.loadItemStackFromNBT(cpt);
    }

  }
View Full Code Here

    nbttagcompound.setInteger("liquidQty", liquidQty);
    nbttagcompound.setInteger("burnTime", burnTime);
    nbttagcompound.setInteger("heat", heat);
   
    if (itemInInventory != null) {
      NBTTagCompound cpt = new NBTTagCompound();
      itemInInventory.writeToNBT(cpt);
      nbttagcompound.setTag("itemInInventory", cpt);
    }

  }
View Full Code Here

TOP

Related Classes of net.minecraft.src.NBTTagCompound

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.