Package net.minecraft.nbt

Examples of net.minecraft.nbt.NBTTagCompound


                                    EntityPlayer par3EntityPlayer) {

    ItemStack cache = super.onItemRightClick(stack, par2World, par3EntityPlayer);
    if (par3EntityPlayer.isSneaking() && !par2World.isRemote) {
      if (stack.stackTagCompound == null) {
        stack.stackTagCompound = new NBTTagCompound();
      }
      if (stack.stackTagCompound.getInteger("Activated") == 0) {
        par3EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.bloodSword.activateEssentiaHarvest"));
        stack.stackTagCompound.setInteger("Activated", 1);
      } else {
View Full Code Here


    private static final String NBT_ASPEPCT_TENDENCIES = "aspectTendencies";

    public static Aspect getAspect(ItemStack stack) {
        AspectList aspectList = new AspectList();
        if (stack.getTagCompound() == null) {
            stack.setTagCompound(new NBTTagCompound());
        }
        aspectList.readFromNBT(stack.getTagCompound().getCompoundTag(NBT_MAIN_ASPECT));

        return aspectList.size() == 0 ? null : aspectList.getAspects()[0];
    }
View Full Code Here

    }


    public static void setAspect(ItemStack stack, Aspect aspect) {
        if (stack.stackTagCompound == null) {
            stack.setTagCompound(new NBTTagCompound());
        }
        AspectList aspectList = new AspectList().add(aspect, 1);
        NBTTagCompound nbt = new NBTTagCompound();
        aspectList.writeToNBT(nbt);
        stack.stackTagCompound.setTag(NBT_MAIN_ASPECT, nbt);
    }
View Full Code Here

    }

    public static AspectList getAspectTendencies(ItemStack stack) {
        AspectList aspectList = new AspectList();
        if (stack.getTagCompound() == null) {
            stack.setTagCompound(new NBTTagCompound());
        }
        aspectList.readFromNBT(stack.getTagCompound().getCompoundTag(NBT_ASPEPCT_TENDENCIES));

        return aspectList;
    }
View Full Code Here

    }


    public static void setAspectTendencies(ItemStack stack, AspectList aspectList) {
        if (stack.stackTagCompound == null) {
            stack.setTagCompound(new NBTTagCompound());
        }
        NBTTagCompound nbt = new NBTTagCompound();
        aspectList.writeToNBT(nbt);
        stack.stackTagCompound.setTag(NBT_ASPEPCT_TENDENCIES, nbt);
    }
View Full Code Here

    }

    if (stackToDisenchant == null)
      return null;

    NBTTagCompound cmp = (NBTTagCompound) stackToDisenchant.getTagCompound().copy();
    cmp.removeTag("ench"); // Remove enchantments
    stackToDisenchant.setTagCompound(cmp);

    return stackToDisenchant;
  }
View Full Code Here

   * this will not do anything if the stack already has a tag
   * compound *
   */
  public static void initNBT(ItemStack stack) {
    if (!detectNBT(stack))
      injectNBT(stack, new NBTTagCompound());
  }
View Full Code Here

  /**
   * If nullifyOnFail is true it'll return null if it doesn't find any
   * compounds, otherwise it'll return a new one. *
   */
  public static NBTTagCompound getCompound(ItemStack stack, String tag, boolean nullifyOnFail) {
    return verifyExistance(stack, tag) ? getNBT(stack).getCompoundTag(tag) : nullifyOnFail ? null : new NBTTagCompound();
  }
View Full Code Here

      int dispersedStrikes = EnchantmentHelper.getEnchantmentLevel(LibEnchantIDs.dispersedStrikes, heldItem);

      if (focusedStrikes > 0 || dispersedStrikes > 0) {
        if (heldItem.stackTagCompound == null) {
          heldItem.stackTagCompound = new NBTTagCompound();
        }
        int lastTarget = heldItem.stackTagCompound.getInteger(NBTLastTarget);
        int successiveStrikes = heldItem.stackTagCompound.getInteger(NBTSuccessiveStrike);
        int entityId = event.entityLiving.getEntityId();
View Full Code Here

  public void onBreakBlock(BlockEvent.BreakEvent event) {
    ItemStack item = event.getPlayer().getCurrentEquippedItem();
    int tunnel = EnchantmentHelper.getEnchantmentLevel(LibEnchantIDs.tunnel, item);
    if (tunnel > 0) {
      if (item.stackTagCompound == null) {
        item.stackTagCompound = new NBTTagCompound();
      }
      float dir = event.getPlayer().rotationYaw;
      item.stackTagCompound.setFloat(NBTTunnelDirection, dir);
    }
  }
View Full Code Here

TOP

Related Classes of net.minecraft.nbt.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.