Package appeng.util

Examples of appeng.util.InventoryAdaptor.addItems()


        SlotCrafting sc = new SlotCrafting( p, real, cOut, 0, 0, 0 );
        sc.onPickupFromSlot( p, is );

        for (int x = 0; x < real.getSizeInventory(); x++)
        {
          ItemStack failed = playerInv.addItems( real.getStackInSlot( x ) );
          if ( failed != null )
            p.dropPlayerItemWithRandomChoice( failed, false );
        }

        inv.addItems( is );
View Full Code Here


        if ( out != null )
        {
          ItemStack is = out.output.copy();
          InventoryAdaptor ad = InventoryAdaptor.getAdaptor( new WrapperInventoryRange( inv, 3, 1, true ), ForgeDirection.UNKNOWN );

          if ( ad.addItems( is ) == null )
          {
            processingTime = 0;
            if ( out.usePlates )
            {
              setInventorySlotContents( 0, null );
View Full Code Here

        IItemList<IAEItemStack> list = inv.getAvailableItems( StorageChannel.ITEMS.createList() );
        if ( list.isEmpty() && ia != null )
        {
          playerInventory.setInventorySlotContents( playerInventory.currentItem, null );

          ItemStack extraB = ia.addItems( this.component.stack( 1 ) );
          ItemStack extraA = ia.addItems( AEApi.instance().materials().materialEmptyStorageCell.stack( 1 ) );

          if ( extraA != null )
            player.dropPlayerItemWithRandomChoice( extraA, false );
          if ( extraB != null )
View Full Code Here

        if ( list.isEmpty() && ia != null )
        {
          playerInventory.setInventorySlotContents( playerInventory.currentItem, null );

          ItemStack extraB = ia.addItems( this.component.stack( 1 ) );
          ItemStack extraA = ia.addItems( AEApi.instance().materials().materialEmptyStorageCell.stack( 1 ) );

          if ( extraA != null )
            player.dropPlayerItemWithRandomChoice( extraA, false );
          if ( extraB != null )
            player.dropPlayerItemWithRandomChoice( extraB, false );
View Full Code Here

    if ( adaptor == null )
      return output;

    int size = output.stackSize;
    output = adaptor.addItems( output );
    int newSize = output == null ? 0 : output.stackSize;

    if ( size != newSize )
      markDirty();
View Full Code Here

        if ( hasItemInHand )
        {
          ItemStack inSlot = theSlot.getStackInSlot( 0 );
          if ( inSlot == null )
            player.inventory.setItemStack( interfaceSlot.addItems( player.inventory.getItemStack() ) );
          else
          {
            inSlot = inSlot.copy();
            ItemStack inHand = player.inventory.getItemStack().copy();
View Full Code Here

            ItemStack inHand = player.inventory.getItemStack().copy();

            theSlot.setInventorySlotContents( 0, null );
            player.inventory.setItemStack( null );

            player.inventory.setItemStack( interfaceSlot.addItems( inHand.copy() ) );

            if ( player.inventory.getItemStack() == null )
              player.inventory.setItemStack( inSlot );
            else
            {
View Full Code Here

        if ( hasItemInHand )
        {
          ItemStack extra = playerHand.removeItems( 1, null, null );
          if ( extra != null )
            extra = interfaceSlot.addItems( extra );
          if ( extra != null )
            playerHand.addItems( extra );
        }
        else if ( is != null )
        {
View Full Code Here

        {
          ItemStack extra = interfaceSlot.removeItems( (is.stackSize + 1) / 2, null, null );
          if ( extra != null )
            extra = playerHand.addItems( extra );
          if ( extra != null )
            interfaceSlot.addItems( extra );
        }

        break;
      case SHIFT_CLICK:
View Full Code Here

        break;
      case SHIFT_CLICK:

        IInventory mySlot = slotInv.getWrapper( slot );
        InventoryAdaptor playerInv = InventoryAdaptor.getAdaptor( player, ForgeDirection.UNKNOWN );
        mySlot.setInventorySlotContents( 0, playerInv.addItems( mySlot.getStackInSlot( 0 ) ) );

        break;
      case MOVE_REGION:

        InventoryAdaptor playerInvAd = InventoryAdaptor.getAdaptor( player, ForgeDirection.UNKNOWN );
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.