Package net.minecraft.inventory

Examples of net.minecraft.inventory.Slot.decrStackSize()


                slot2.decrStackSize(itemstack5.stackSize);
                slot2.putStack((ItemStack)null);
                slot2.onPickupFromSlot(par4EntityPlayer, itemstack5);
              }
            } else {
              slot2.decrStackSize(itemstack5.stackSize);
              slot2.putStack(itemstack3);
              slot2.onPickupFromSlot(par4EntityPlayer, itemstack5);
            }
          } else if(!slot2.getHasStack() && itemstack3 != null && slot2.isItemValid(itemstack3)) {
            inventoryplayer.setInventorySlotContents(par2, (ItemStack)null);
View Full Code Here


        }
      } else if(par3 == 4 && inventoryplayer.getItemStack() == null && par1 >= 0) {
        slot2 = (Slot)this.inventorySlots.get(par1);
       
        if(slot2 != null && slot2.getHasStack() && slot2.canTakeStack(par4EntityPlayer)) {
          itemstack3 = slot2.decrStackSize(par2 == 0 ? 1 : slot2.getStack().stackSize);
          slot2.onPickupFromSlot(par4EntityPlayer, itemstack3);
          par4EntityPlayer.dropPlayerItemWithRandomChoice(itemstack3, true);
        }
      } else if(par3 == 6 && par1 >= 0) {
        slot2 = (Slot)this.inventorySlots.get(par1);
View Full Code Here

            for(int j2 = i1; j2 >= 0 && j2 < this.inventorySlots.size() && itemstack3.stackSize < itemstack3.getMaxStackSize(); j2 += l1) {
              Slot slot3 = (Slot)this.inventorySlots.get(j2);
             
              if(slot3.getHasStack() && func_94527_a(slot3, itemstack3, true) && slot3.canTakeStack(par4EntityPlayer) && this.func_94530_a(itemstack3, slot3) && (i2 != 0 || slot3.getStack().stackSize != slot3.getStack().getMaxStackSize())) {
                int k1 = Math.min(itemstack3.getMaxStackSize() - itemstack3.stackSize, slot3.getStack().stackSize);
                ItemStack itemstack2 = slot3.decrStackSize(k1);
                itemstack3.stackSize += k1;
               
                if(itemstack2.stackSize <= 0) {
                  slot3.putStack((ItemStack)null);
                }
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.