Package appeng.api.storage

Examples of appeng.api.storage.IMEInventoryHandler


  public boolean openGui(EntityPlayer p, ICellHandler ch, ItemStack cell, int side)
  {
    try
    {
      IMEInventoryHandler invHandler = this.getHandler( StorageChannel.ITEMS );
      if ( ch != null && invHandler != null )
      {
        ch.openChestGui( p, this, ch, invHandler, cell, StorageChannel.ITEMS );
        return true;
      }

    }
    catch (ChestNoHandler e)
    {
      // :P
    }

    try
    {
      IMEInventoryHandler invHandler = this.getHandler( StorageChannel.FLUIDS );
      if ( ch != null && invHandler != null )
      {
        ch.openChestGui( p, this, ch, invHandler, cell, StorageChannel.FLUIDS );
        return true;
      }
View Full Code Here


    if ( ch != null )
    {
      try
      {
        IMEInventoryHandler handler = getHandler( StorageChannel.ITEMS );
        if ( handler instanceof ChestMonitorHandler )
          return ch.getStatusForCell( cell, ((ChestMonitorHandler) handler).getInternalHandler() );
      }
      catch (ChestNoHandler ignored)
      {
      }

      try
      {
        IMEInventoryHandler handler = getHandler( StorageChannel.FLUIDS );
        if ( handler instanceof ChestMonitorHandler )
          return ch.getStatusForCell( cell, ((ChestMonitorHandler) handler).getInternalHandler() );
      }
      catch (ChestNoHandler ignored)
      {
View Full Code Here

    double available = extractAEPower( req, Actionable.SIMULATE, PowerMultiplier.CONFIG );
    if ( available >= req - 0.01 )
    {
      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();
View Full Code Here

  @Override
  public boolean canFill(ForgeDirection from, Fluid fluid)
  {
    try
    {
      IMEInventoryHandler h = getHandler( StorageChannel.FLUIDS );
      return h.canAccept( AEFluidStack.create( new FluidStack( fluid, 1 ) ) );
    }
    catch (ChestNoHandler ignored)
    {
    }
    return false;
View Full Code Here

  @Override
  public FluidTankInfo[] getTankInfo(ForgeDirection from)
  {
    try
    {
      IMEInventoryHandler h = getHandler( StorageChannel.FLUIDS );
      if ( h.getChannel() == StorageChannel.FLUIDS )
        return new FluidTankInfo[] { new FluidTankInfo( null, 1 ) }; // eh?
    }
    catch (ChestNoHandler ignored)
    {
    }
View Full Code Here

  @Override
  public List<IMEInventoryHandler> getCellArray(StorageChannel channel)
  {
    if ( channel == StorageChannel.ITEMS )
    {
      IMEInventoryHandler out = proxy.isActive() ? getInternalHandler() : null;
      if ( out != null )
        return Arrays.asList( out );
    }
    return Arrays.asList( new IMEInventoryHandler[] {} );
  }
View Full Code Here

        {
          handlersBySlot[x] = AEApi.instance().registries().cell().getHandler( is );

          if ( handlersBySlot[x] != null )
          {
            IMEInventoryHandler cell = handlersBySlot[x].getCellInventory( is, this, StorageChannel.ITEMS );

            if ( cell != null )
            {
              power += handlersBySlot[x].cellIdleDrain( is, cell );
View Full Code Here

TOP

Related Classes of appeng.api.storage.IMEInventoryHandler

Copyright © 2018 www.massapicom. 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.