Examples of decrStackSize()


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

            inventoryPlayer.setInventorySlotContents(p_75144_2_, itemstack5.copy());

            if ((slot2.inventory != inventoryPlayer || !slot2.isItemValid(itemstack3)) && itemstack3 != null) {
              if (l1 > -1) {
                inventoryPlayer.addItemStackToInventory(itemstack3);
                slot2.decrStackSize(itemstack5.stackSize);
                slot2.putStack((ItemStack) null);
                slot2.onPickupFromSlot(player, itemstack5);
              }
            } else {
              slot2.decrStackSize(itemstack5.stackSize);
View Full Code Here

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

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

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

        }
      } else if (p_75144_3_ == 4 && inventoryPlayer.getItemStack() == null && slotIndex >= 0) {
        slot2 = (Slot) this.inventorySlots.get(slotIndex);

        if (slot2 != null && slot2.getHasStack() && slot2.canTakeStack(player)) {
          itemstack3 = slot2.decrStackSize(p_75144_2_ == 0 ? 1 : slot2.getStack().stackSize);
          slot2.onPickupFromSlot(player, itemstack3);
          player.dropPlayerItemWithRandomChoice(itemstack3, true);
        }
      } else if (p_75144_3_ == 6 && slotIndex >= 0) {
        slot2 = (Slot) this.inventorySlots.get(slotIndex);
View Full Code Here

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

              Slot slot3 = (Slot) this.inventorySlots.get(j2);

              if (slot3.getHasStack() && func_94527_a(slot3, itemstack3, true) && slot3.canTakeStack(player)
                  && 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

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

                        ContainerBeacon containerbeacon = (ContainerBeacon)net.playerEntity.openContainer;
                        Slot slot = containerbeacon.getSlot(0);

                        if (slot.getHasStack())
                        {
                            slot.decrStackSize(1);
                            TileEntityBeacon tileentitybeacon = containerbeacon.func_148327_e();
                            tileentitybeacon.setPrimaryEffect(i);
                            tileentitybeacon.setSecondaryEffect(j);
                            tileentitybeacon.markDirty();
                        }
View Full Code Here

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

                }
              }
            } else if(slot2.canTakeStack(par4EntityPlayer)) {
              if(itemstack4 == null) {
                l1 = par2 == 0 ? itemstack3.stackSize : (itemstack3.stackSize + 1) / 2;
                itemstack5 = slot2.decrStackSize(l1);
                inventoryplayer.setItemStack(itemstack5);
               
                if(itemstack3.stackSize == 0) {
                  slot2.putStack((ItemStack)null);
                }
View Full Code Here

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

              } else if(itemstack3.getItem() == itemstack4.getItem() && itemstack4.getMaxStackSize() > 1 && (!itemstack3.getHasSubtypes() || itemstack3.getItemDamage() == itemstack4.getItemDamage()) && ItemStack.areItemStackTagsEqual(itemstack3, itemstack4)) {
                l1 = itemstack3.stackSize;
               
                if(l1 > 0 && l1 + itemstack4.stackSize <= itemstack4.getMaxStackSize()) {
                  itemstack4.stackSize += l1;
                  itemstack3 = slot2.decrStackSize(l1);
                 
                  if(itemstack3.stackSize == 0) {
                    slot2.putStack((ItemStack)null);
                  }
                 
View Full Code Here

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

            inventoryplayer.setInventorySlotContents(par2, itemstack5.copy());
           
            if((slot2.inventory != inventoryplayer || !slot2.isItemValid(itemstack3)) && itemstack3 != null) {
              if(l1 > -1) {
                inventoryplayer.addItemStackToInventory(itemstack3);
                slot2.decrStackSize(itemstack5.stackSize);
                slot2.putStack((ItemStack)null);
                slot2.onPickupFromSlot(par4EntityPlayer, itemstack5);
              }
            } else {
              slot2.decrStackSize(itemstack5.stackSize);
View Full Code Here

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

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

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