Package appeng.util

Examples of appeng.util.InventoryAdaptor.addItems()


      case MOVE_REGION:

        InventoryAdaptor playerInvAd = InventoryAdaptor.getAdaptor( player, ForgeDirection.UNKNOWN );
        for (int x = 0; x < inv.server.getSizeInventory(); x++)
        {
          inv.server.setInventorySlotContents( x, playerInvAd.addItems( inv.server.getStackInSlot( x ) ) );
        }

        break;
      case CREATIVE_DUPLICATE:
View Full Code Here


        if ( myItem != null )
          ais.setStackSize( ais.getStackSize() - myItem.stackSize );

        ais = Platform.poweredExtraction( powerSrc, cellInv, ais, mySrc );
        if ( ais != null )
          adp.addItems( ais.getItemStack() );
      }
      break;
    case ROLL_DOWN:
      if ( powerSrc == null || cellInv == null )
        return;
View Full Code Here

          ais = Platform.poweredExtraction( powerSrc, cellInv, ais, mySrc );
          if ( ais != null )
          {
            InventoryAdaptor ia = new AdaptorPlayerHand( player );

            ItemStack fail = ia.addItems( ais.getItemStack() );
            if ( fail != null )
              cellInv.injectItems( ais, Actionable.MODULATE, mySrc );

            updateHeld( player );
          }
View Full Code Here

          if ( myItem != null )
            ais.setStackSize( ais.getStackSize() - myItem.stackSize );

          ais = Platform.poweredExtraction( powerSrc, cellInv, ais, mySrc );
          if ( ais != null )
            adp.addItems( ais.getItemStack() );
          else
            return;
        }
      }
View Full Code Here

    for ( int x = 0; x < maxTimesToCraft; x++ )
    {
      if ( ia.simulateAdd( rs ) == null )
      {
        IItemList<IAEItemStack> all = inv.getStorageList();
        ItemStack extra = ia.addItems( craftItem( who, rs, inv, all ) );
        if ( extra != null )
        {
          List<ItemStack> drops = new ArrayList<ItemStack>();
          drops.add( extra );
          Platform.spawnDrops( who.worldObj, ( int ) who.posX, ( int ) who.posY, ( int ) who.posZ, drops );
View Full Code Here

        IAEItemStack acquired = Platform.poweredExtraction( src, destination, itemStack, mySrc );
        if ( acquired != null )
        {
          changed = true;
          ItemStack issue = adaptor.addItems( acquired.getItemStack() );
          if ( issue != null )
            throw new RuntimeException( "bad attempt at managing inventory. ( addItems )" );
        }
        else
          changed = handleCrafting( x, adaptor, itemStack ) || changed;
View Full Code Here

          for (int x = 0; x < table.getSizeInventory(); x++)
          {
            ItemStack is = table.getStackInSlot( x );
            if ( is != null )
            {
              addToSendList( ad.addItems( is ) );
            }
          }
          pushItemsOut( possibleDirections );
          return true;
        }
View Full Code Here

          continue;

        InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, s.getOpposite() );
        if ( ad != null )
        {
          ItemStack Result = ad.addItems( whatToSend );

          if ( Result == null )
            whatToSend = null;
          else
            whatToSend.stackSize -= whatToSend.stackSize - Result.stackSize;
View Full Code Here

      if ( mode == Actionable.SIMULATE )
        return AEItemStack.create( adaptor.simulateAdd( acquired.getItemStack() ) );
      else
      {
        IAEItemStack is = AEItemStack.create( adaptor.addItems( acquired.getItemStack() ) );
        updatePlan( slot );
        return is;
      }
    }
View Full Code Here

        double power = items.getStackSize();
        if ( energy.extractAEPower( power, mode, PowerMultiplier.CONFIG ) > power - 0.01 )
        {
          if ( mode == Actionable.MODULATE )
            return AEItemStack.create( d.addItems( items.getItemStack() ) );
          return AEItemStack.create( d.simulateAdd( items.getItemStack() ) );
        }
      }
    }
    catch (GridAccessException e)
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.