Examples of canTakeStack()


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

          if (slotIndex < 0) {
            return null;
          }
          slot2 = (Slot) this.inventorySlots.get(slotIndex);

          if (slot2 != null && slot2.canTakeStack(player)) {
            itemstack3 = this.transferStackInSlot(player, slotIndex);

            if (itemstack3 != null) {
              Item item = itemstack3.getItem();
              stack = itemstack3.copy();
View Full Code Here

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

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

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

          }
        }
      } else if (p_75144_3_ == 2 && p_75144_2_ >= 0 && p_75144_2_ < 9) {
        slot2 = (Slot) this.inventorySlots.get(slotIndex);

        if (slot2.canTakeStack(player)) {
          itemstack3 = inventoryPlayer.getStackInSlot(p_75144_2_);
          boolean flag = itemstack3 == null || slot2.inventory == inventoryPlayer && slot2.isItemValid(itemstack3);
          l1 = -1;

          if (!flag) {
View Full Code Here

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

          inventoryPlayer.setItemStack(itemstack3);
        }
      } 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) {
View Full Code Here

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

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

        if (itemstack3 != null && (slot2 == null || !slot2.getHasStack() || !slot2.canTakeStack(player))) {
          i1 = p_75144_2_ == 0 ? 0 : this.inventorySlots.size() - 1;
          l1 = p_75144_2_ == 0 ? 1 : -1;

          for (int i2 = 0; i2 < 2; ++i2) {
            for (int j2 = i1; j2 >= 0 && j2 < this.inventorySlots.size() && itemstack3.stackSize < itemstack3.getMaxStackSize(); j2 += l1) {
View Full Code Here

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

          for (int i2 = 0; i2 < 2; ++i2) {
            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(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;
View Full Code Here

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

    if( slot instanceof SlotCraft ) {
      if( player.worldObj.isRemote ) // the server should handle this.
        return null;

      if( !slot.canTakeStack( player ) )
        return null;
      // add to the resources buffer.
      stackInSlot = ((SlotCraft) slot).getCraftedStack();
      ItemStack copy = stackInSlot == null ? null : stackInSlot.copy();
View Full Code Here

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

        case 10: // redirect the right click into a left click.
          return slotClick( slotID, 0, flag, player );

        case 11: // regular clicking on an output slot.

          if( !slot.getHasStack() || !slot.canTakeStack( player ) )
            return null;

          stackInSlot = ((SlotCraft) slot).getCraftedStack();
          playerStack = inventoryPlayer.getItemStack();
View Full Code Here

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

          }
          slot.onSlotChanged();
          return stackInSlot;

        case 12: // interacting with the hotkeys
          if( !slot.canTakeStack( player ) )
            return null;
          stackInSlot = ((SlotCraft) slot).getCraftedStack();

          if( stackInSlot == null )
          return null;
View Full Code Here

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

            }
          }
          return stackInSlot;

        case 14: // dropping from an output slot.
          if( slot.getHasStack() && slot.canTakeStack( player ) ) {
            ItemStack itemStack = ((SlotCraft) slot).getCraftedStack();
            slot.onPickupFromSlot( player, itemStack );
            player.dropPlayerItem( ((SlotCraft) slot).getCraftedStack() );
            return itemStack;
          }
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.