Examples of ItemStack


Examples of net.minecraft.item.ItemStack

    return foundCloth && foundEnchanted;
  }

  @Override
  public ItemStack getCraftingResult(InventoryCrafting var1) {
    ItemStack stackToDisenchant = null;
    for (int i = 0; i < var1.getSizeInventory(); i++) {
      ItemStack stack = var1.getStackInSlot(i);
      if (stack != null && stack.isItemEnchanted()) {
        stackToDisenchant = stack.copy();
        break;
      }
    }

    if (stackToDisenchant == null)
View Full Code Here

Examples of net.minecraft.item.ItemStack

  }

  @Override
  public IRegisterableResearch getResearchItem() {
    if (setBlock == ThaumicTinkerer.registry.getFirstBlockFromClass(BlockGaseousShadow.class)) {
      IRegisterableResearch research = (TTResearchItem) new TTResearchItem(LibResearch.KEY_GASEOUS_SHADOW, new AspectList().add(Aspect.DARKNESS, 2).add(Aspect.AIR, 1).add(Aspect.MOTION, 4), -1, -5, 2, new ItemStack(this)).setSecondary().setParents(LibResearch.KEY_GASEOUS_LIGHT)
          .setPages(new ResearchPage("0"), ResearchHelper.crucibleRecipePage(LibResearch.KEY_GASEOUS_SHADOW));
      return research;
    }
    if (setBlock == ThaumicTinkerer.registry.getFirstBlockFromClass(BlockGaseousLight.class)) {
      IRegisterableResearch research = (TTResearchItem) new TTResearchItem(LibResearch.KEY_GASEOUS_LIGHT, new AspectList().add(Aspect.LIGHT, 2).add(Aspect.AIR, 1), 0, -3, 1, new ItemStack(this)).setParents("NITOR")
          .setPages(new ResearchPage("0"), ResearchHelper.crucibleRecipePage(LibResearch.KEY_GASEOUS_LIGHT));
      return research;
    }
    return null;
  }
View Full Code Here

Examples of net.minecraft.item.ItemStack

  }

  @Override
  public ThaumicTinkererRecipe getRecipeItem() {
    if (setBlock == ThaumicTinkerer.registry.getFirstBlockFromClass(BlockGaseousLight.class)) {
      return new ThaumicTinkererCrucibleRecipe(LibResearch.KEY_GASEOUS_LIGHT, new ItemStack(this), new ItemStack(ConfigItems.itemEssence, 1, 0), new AspectList().add(Aspect.LIGHT, 16).add(Aspect.AIR, 10).add(Aspect.MOTION, 8));
    }
    if (setBlock == ThaumicTinkerer.registry.getFirstBlockFromClass(BlockGaseousShadow.class)) {
      return new ThaumicTinkererCrucibleRecipe(LibResearch.KEY_GASEOUS_SHADOW, new ItemStack(this), new ItemStack(ConfigItems.itemEssence, 1, 0), new AspectList().add(Aspect.DARKNESS, 16).add(Aspect.AIR, 10).add(Aspect.MOTION, 8));
    }
    return null;
  }
View Full Code Here

Examples of net.minecraft.item.ItemStack

  @SubscribeEvent
  public void onEntityDamaged(LivingHurtEvent event) {
    if (event.source.getEntity() instanceof EntityLivingBase) {
      EntityLivingBase attacker = (EntityLivingBase) event.source.getEntity();
      ItemStack heldItem = attacker.getHeldItem();

      if (heldItem == null)
        return;

     
      if (attacker instanceof EntityPlayer) {
        EntityPlayer player = (EntityPlayer) attacker;

        ItemStack legs = player.getCurrentArmor(1);
        int pounce = EnchantmentHelper.getEnchantmentLevel(LibEnchantIDs.pounce, legs);
        if (pounce > 0) {
          if (player.worldObj.getBlock((int) Math.floor(player.posX), (int) Math.floor(player.posY) - 1, (int) Math.floor(player.posZ)) == net.minecraft.init.Blocks.air) {

            event.ammount *= 1 + (.25 * pounce);
 
View Full Code Here

Examples of net.minecraft.item.ItemStack

        event.entityLiving.fallDistance = Math.max(2.9F, player.fallDistance - slowfall / 3F);

        player.worldObj.spawnParticle("cloud", player.posX + 0.25, player.posY - 1, player.posZ + 0.25, -player.motionX, player.motionY, -player.motionZ);
      }

      ItemStack heldItem = player.getHeldItem();

      if (heldItem == null)
        return;

      int quickDraw = EnchantmentHelper.getEnchantmentLevel(LibEnchantIDs.idQuickDraw, heldItem);
            ItemStack usingItem = player.itemInUse;
            int time = player.itemInUseCount;
            if (quickDraw > 0 && usingItem != null && usingItem.getItem() instanceof ItemBow)
        if ((usingItem.getItem().getMaxItemUseDuration(usingItem) - time) % (6 - quickDraw) == 0)
          player.itemInUseCount = time - 1;
    }
  }
View Full Code Here

Examples of net.minecraft.item.ItemStack

  }

  @SubscribeEvent(priority = EventPriority.LOW)
  public void onFall(LivingFallEvent event) {
    if (event.entityLiving instanceof EntityPlayer) {
      ItemStack boots = ((EntityPlayer) event.entityLiving).getCurrentArmor(0);
      int shockwave = EnchantmentHelper.getEnchantmentLevel(LibEnchantIDs.shockwave, boots);
      if (shockwave > 0) {
        for (EntityLivingBase target : (List<EntityLivingBase>) event.entity.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(event.entity.posX - 10, event.entity.posY - 10, event.entity.posZ - 10, event.entity.posX + 10, event.entity.posY + 10, event.entity.posZ + 10))) {
          if (target != event.entity && event.distance > 3) {
            target.attackEntityFrom(DamageSource.fall, .1F * shockwave * event.distance);
 
View Full Code Here

Examples of net.minecraft.server.ItemStack

   *
   * @param item ItemStack
   * @param compound TagCompound
   */
  public static void saveItemStack(org.bukkit.inventory.ItemStack item, CommonTagCompound compound) {
    ItemStack stack = (ItemStack) HandleConverter.toItemStackHandle.convert(item);
    stack.save((NBTTagCompound) compound.getHandle());
  }
View Full Code Here

Examples of net.minecraft.server.v1_6_R3.ItemStack

  }

  @Override
  public ItemStack splitWithoutUpdate(int i) {
    if (this.items[i] != null) {
      ItemStack itemstack = this.items[i];

      this.items[i] = null;
      return itemstack;
    } else {
      return null;
View Full Code Here

Examples of net.minecraft.src.ItemStack

    //System.out.println(Temp.ItemID + ":" + this.ItemID + " - " + Temp.ItemDamage + ":" + this.ItemDamage + " - " + Temp.StackSize + ":" + this.StackSize);
    return Temp.ItemID == this.ItemID && (Temp.ItemDamage == this.ItemDamage || this.ItemDamage == -1 || Temp.ItemDamage == -1);
  }
  public ItemStack toItemStack()
  {
    return new ItemStack(ItemID, StackSize, ItemDamage);
  }
View Full Code Here

Examples of org.bukkit.inventory.ItemStack

          // fill player's inventory with the reward
          for (String reward : s) {
            try {
              if (reward.contains(":")) {
                String[] expl = reward.split(":");
                pi.addItem(new ItemStack(Integer.parseInt(expl[0]), f.getInt("quizDiff." + quizWinners.get(pName) + "." + reward), (short) 0, Byte.parseByte(expl[1])));
              } else {
                pi.addItem(new ItemStack(Integer.parseInt(reward), f.getInt("quizDiff." + quizWinners.get(pName) + "." + reward)));
              }
            } catch (Throwable e) {
              // unable to add item into inventory, inform server owner
              LogHelper.logSevere("[CommandsEX] " + _("quizUnableToAddItem", "") + reward + ":" + f.getInt("quizDiff." + quizWinners.get(pName) + "." + reward));
              LogHelper.logDebug("Message: " + e.getMessage() + ", cause: " + e.getCause());
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.