Examples of NBTTagCompound


Examples of net.minecraft.nbt.NBTTagCompound

  }

  public static ItemStack setDefaultEnergyTag(ItemStack container, int energy) {

    if (container.stackTagCompound == null) {
      container.setTagCompound(new NBTTagCompound());
    }
    container.stackTagCompound.setInteger("Energy", energy);

    return container;
  }
View Full Code Here

Examples of net.minecraft.server.v1_4_R1.NBTTagCompound

   
    String   author  = storage.getString  (tagStringAuthor);
    String   title  = storage.getString  (tagStringTitle);
    Integer pSize  = storage.getInteger(tagIntegerPagesSize);
   
    NBTTagCompound compound  = new NBTTagCompound();
   
    if (pSize != null) {
      NBTTagList  list  = new NBTTagList();
      for (int i = 0; i < pSize; i++) {
        String       page  = storage.getString(tagStringPagePref+i);
       
        if (page != null) {
          NBTTagString tag  = new NBTTagString(page);
          tag.data      = page;
          list.add(tag);
        }
      }
     
      compound.set(tagStringPages, list);
    }
   
    if (title != null)
      compound.setString(tagStringTitle, title);
   
    if (author != null)
      compound.setString(tagStringAuthor, author);
   
   
    return compound;
  }
View Full Code Here

Examples of net.minecraft.server.v1_7_R4.NBTTagCompound

    public static boolean hasCustomNBT(LivingEntity entity, String key) {
        if (entity == null) return false;
        Entity bukkitEntity = entity;
        net.minecraft.server.v1_7_R4.Entity nmsEntity = ((CraftEntity) bukkitEntity).getHandle();
        NBTTagCompound tag = new NBTTagCompound();

        // Writes the entity's NBT data to tag
        nmsEntity.c(tag);

        // Check for key
        return tag.hasKey(key);
    }
View Full Code Here

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