Examples of IAEStack


Examples of appeng.api.storage.data.IAEStack

      try
      {
        IMEInventoryHandler h = getHandler( StorageChannel.FLUIDS );

        extractAEPower( req, Actionable.MODULATE, PowerMultiplier.CONFIG );
        IAEStack results = h.injectItems( AEFluidStack.create( resource ), doFill ? Actionable.MODULATE : Actionable.SIMULATE, mySrc );

        if ( results == null )
          return resource.amount;

        return resource.amount - (int) results.getStackSize();
      }
      catch (ChestNoHandler ignored)
      {
      }
    }
View Full Code Here

Examples of appeng.api.storage.data.IAEStack

      myList = src.getAvailableItems( src.getChannel().createList() );

    if ( fm == FullnessMode.EMPTY )
      return myList.isEmpty();

    IAEStack test = myList.getFirstItem();
    if ( test != null )
    {
      test.setStackSize( 1 );
      return src.injectItems( test, Actionable.SIMULATE, mySrc ) != null;
    }
    return false;
  }
View Full Code Here

Examples of appeng.api.storage.data.IAEStack

      for (IAEStack s : myList)
      {
        long totalStackSize = s.getStackSize();
        if ( totalStackSize > 0 )
        {
          IAEStack stack = dest.injectItems( s, Actionable.SIMULATE, mySrc );

          long possible = 0;
          if ( stack == null )
            possible = totalStackSize;
          else
            possible = totalStackSize - stack.getStackSize();

          if ( possible > 0 )
          {
            possible = Math.min( possible, itemsToMove );
            s.setStackSize( possible );

            IAEStack extracted = src.extractItems( s, Actionable.MODULATE, mySrc );
            if ( extracted != null )
            {
              possible = extracted.getStackSize();
              IAEStack failed = Platform.poweredInsert( energy, dest, extracted, mySrc );

              if ( failed != null )
              {
                possible -= failed.getStackSize();
                src.injectItems( failed, Actionable.MODULATE, mySrc );
              }

              if ( possible > 0 )
              {
View Full Code Here

Examples of appeng.api.storage.data.IAEStack

      IMEInventory inv = AEApi.instance().registries().cell().getCellInventory( item, null, StorageChannel.ITEMS );
      if ( inv != null )
      {
        IItemList itemList = inv.getAvailableItems( AEApi.instance().storage().createItemList() );
        IAEStack aeAmmo = itemList.getFirstItem();
        if ( aeAmmo instanceof IAEItemStack )
        {
          shots = Math.min( shots, (int) aeAmmo.getStackSize() );
          for (int sh = 0; sh < shots; sh++)
          {
            extractAEPower( item, 1600 );

            if ( Platform.isClient() )
              return item;

            aeAmmo.setStackSize( 1 );
            ItemStack ammo = ((IAEItemStack) aeAmmo).getItemStack();
            if ( ammo == null )
              return item;

            ammo.stackSize = 1;
View Full Code Here

Examples of appeng.api.storage.data.IAEStack

    }

    if ( ThingOfInterest instanceof IPartStorageMonitor )
    {
      IPartStorageMonitor psm = (IPartStorageMonitor) ThingOfInterest;
      IAEStack stack = psm.getDisplayed();
      boolean isLocked = psm.isLocked();

      if ( stack instanceof IAEItemStack )
      {
        IAEItemStack ais = (IAEItemStack) stack;
View Full Code Here

Examples of appeng.api.storage.data.IAEStack

      if ( myGridCache.interestManager.containsKey( changedItem ) )
      {
        Collection<ItemWatcher> list = myGridCache.interestManager.get( changedItem );
        if ( !list.isEmpty() )
        {
          IAEStack fullStack = myStorageList.findPrecise( changedItem );
          if ( fullStack == null )
          {
            fullStack = changedItem.copy();
            fullStack.setStackSize( 0 );
          }

          myGridCache.interestManager.enableTransactions();

          for (ItemWatcher iw : list)
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.