Examples of damageItem()


Examples of net.minecraft.item.ItemStack.damageItem()

    boolean desintegrateApplies = desintegrate > 0 && event.block.blockHardness <= 1.5F;
    boolean autoSmeltApplies = autoSmelt > 0 && event.block.getMaterial() == Material.wood;

    if (desintegrateApplies || autoSmeltApplies) {
      heldItem.damageItem(1, event.entityPlayer);
      event.newSpeed = Float.MAX_VALUE;
    } else if (desintegrate > 0 || autoSmelt > 0)
      event.setCanceled(true);
  }
}
View Full Code Here

Examples of net.minecraft.item.ItemStack.damageItem()

      tool.getItem().onBlockDestroyed(tool, worldObj, blk, bc.x, bc.y, bc.z, farmerJoe);     
    } else if(tool.getItem() instanceof ItemHoe) {
      int origDamage = tool.getItemDamage();
      tool.getItem().onItemUse(tool, farmerJoe, worldObj, bc.x, bc.y, bc.z, 1, 0.5f, 0.5f, 0.5f);
      if(origDamage == tool.getItemDamage() && tool.isItemStackDamageable()) {
        tool.damageItem(1, farmerJoe);
      }     
    } else if(tool.isItemStackDamageable()) {
      tool.damageItem(1, farmerJoe);
    }
View Full Code Here

Examples of net.minecraft.item.ItemStack.damageItem()

      tool.getItem().onItemUse(tool, farmerJoe, worldObj, bc.x, bc.y, bc.z, 1, 0.5f, 0.5f, 0.5f);
      if(origDamage == tool.getItemDamage() && tool.isItemStackDamageable()) {
        tool.damageItem(1, farmerJoe);
      }     
    } else if(tool.isItemStackDamageable()) {
      tool.damageItem(1, farmerJoe);
    }

    if(tool.isItemStackDamageable() && tool.getItemDamage() >= tool.getMaxDamage()) {
      destroyTool(class1);
    }
View Full Code Here

Examples of net.minecraft.item.ItemStack.damageItem()

                        tankInSlot.damageItem(1, player);
                    }

                    if (tankInSlot2 != null && tankInSlot2.getMaxDamage() - tankInSlot2.getItemDamage() > 0)
                    {
                        tankInSlot2.damageItem(1, player);
                    }
                }

                if (tankInSlot != null)
                {
View Full Code Here

Examples of net.minecraft.item.ItemStack.damageItem()

    {
        ItemStack stack = entityPlayer.inventory.getCurrentItem();

        if (stack != null)
        {
            stack.damageItem(1, entityPlayer);

            if (stack.getItemDamage() >= stack.getMaxDamage())
            {
                stack.stackSize--;
            }
View Full Code Here

Examples of net.minecraft.item.ItemStack.damageItem()

                        {
                            if (DEBUG)
                            {
                                System.out.println("Item: " + stack.toString() + " Absorbed: " + (absorb / 25D) + " Damaged: " + itemDamage);
                            }
                            stack.damageItem(itemDamage, entity);
                        }
                        if (stack.stackSize <= 0)
                        {
                            /*if (entity instanceof EntityPlayer)
                            {
View Full Code Here

Examples of net.minecraft.item.ItemStack.damageItem()

    if (Proxies.common.isSimulating(world)) {
      if (player != null) {
        ItemStack held = player.inventory.getCurrentItem();
        if (held != null && held.getItem() instanceof IToolGrafter) {
          saplingModifier = ((IToolGrafter) held.getItem()).getSaplingModifier(held, world, player, x, y, z);
          held.damageItem(1, player);
          if (held.stackSize <= 0)
            player.destroyCurrentEquippedItem();
        }
      }
    }
View Full Code Here

Examples of net.minecraft.item.ItemStack.damageItem()

  private boolean makePlate()
  {
    if ( inSlot.decrStackSize( 0, 1 ) != null )
    {
      ItemStack item = toolInv.getItemStack();
      item.damageItem( 1, getPlayerInv().player );

      if ( item.stackSize == 0 )
      {
        getPlayerInv().mainInventory[getPlayerInv().currentItem] = null;
        MinecraftForge.EVENT_BUS.post( new PlayerDestroyItemEvent( getPlayerInv().player, item ) );
View Full Code Here

Examples of net.minecraft.item.ItemStack.damageItem()

            ItemStack current = player.getCurrentEquippedItem();
            if (current != null && current.getItem() instanceof ItemWhistleTuner) {
                if (whistleDelay <= 0) {
                    whistlePitch = getNewWhistlePitch();
                    whistle();
                    current.damageItem(1, player);
                }
                return true;
            }
            if (this instanceof IFluidHandler && FluidHelper.handleRightClick((IFluidHandler) this, ForgeDirection.UNKNOWN, player, true, false))
                return true;
View Full Code Here

Examples of net.minecraft.item.ItemStack.damageItem()

        ItemStack stack = player.inventory.getCurrentItem();
        if (stack != null) {
            if (stack.getItem() == Items.flint_and_steel
                    || stack.getItem() instanceof ItemFirestoneRefined) {
                setPrimed(true);
                stack.damageItem(1, player);
            } else if (stack.getItem() == Items.string) {
                player.inventory.decrStackSize(player.inventory.currentItem, 1);
                GuiHandler.openGui(EnumGui.CART_TNT_FUSE, player, worldObj, this);
            } else if (stack.getItem() == Items.gunpowder) {
                player.inventory.decrStackSize(player.inventory.currentItem, 1);
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.