Package appeng.me

Examples of appeng.me.GridAccessException


      {
        // make sure strange things didn't happen...
        if ( adaptor.simulateAdd( itemStack.getItemStack() ) != null )
        {
          changed = true;
          throw new GridAccessException();
        }

        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;
      }
      else if ( itemStack.getStackSize() < 0 )
      {
        IAEItemStack toStore = itemStack.copy();
        toStore.setStackSize( -toStore.getStackSize() );

        long diff = toStore.getStackSize();

        // make sure strange things didn't happen...
        ItemStack canExtract = adaptor.simulateRemove( (int) diff, toStore.getItemStack(), null );
        if ( canExtract == null || canExtract.stackSize != diff )
        {
          changed = true;
          throw new GridAccessException();
        }

        toStore = Platform.poweredInsert( src, destination, toStore, mySrc );

        if ( toStore != null )
View Full Code Here


   * @throws GridAccessException of node or grid is null
   */
  public IGrid getGrid() throws GridAccessException
  {
    if ( node == null )
      throw new GridAccessException();
    IGrid grid = node.getGrid();
    if ( grid == null )
      throw new GridAccessException();
    return grid;
  }
View Full Code Here

  public IEnergyGrid getEnergy() throws GridAccessException
  {
    IGrid grid = getGrid();
    if ( grid == null )
      throw new GridAccessException();
    IEnergyGrid eg = grid.getCache( IEnergyGrid.class );
    if ( eg == null )
      throw new GridAccessException();
    return eg;
  }
View Full Code Here

  public IPathingGrid getPath() throws GridAccessException
  {
    IGrid grid = getGrid();
    if ( grid == null )
      throw new GridAccessException();
    IPathingGrid pg = grid.getCache( IPathingGrid.class );
    if ( pg == null )
      throw new GridAccessException();
    return pg;
  }
View Full Code Here

  public ITickManager getTick() throws GridAccessException
  {
    IGrid grid = getGrid();
    if ( grid == null )
      throw new GridAccessException();
    ITickManager pg = grid.getCache( ITickManager.class );
    if ( pg == null )
      throw new GridAccessException();
    return pg;
  }
View Full Code Here

  public IStorageGrid getStorage() throws GridAccessException
  {
    IGrid grid = getGrid();
    if ( grid == null )
      throw new GridAccessException();

    IStorageGrid pg = grid.getCache( IStorageGrid.class );

    if ( pg == null )
      throw new GridAccessException();

    return pg;
  }
View Full Code Here

  public P2PCache getP2P() throws GridAccessException
  {
    IGrid grid = getGrid();
    if ( grid == null )
      throw new GridAccessException();

    P2PCache pg = grid.getCache( P2PCache.class );

    if ( pg == null )
      throw new GridAccessException();

    return pg;
  }
View Full Code Here

  public ISecurityGrid getSecurity() throws GridAccessException
  {
    IGrid grid = getGrid();
    if ( grid == null )
      throw new GridAccessException();

    ISecurityGrid sg = grid.getCache( ISecurityGrid.class );

    if ( sg == null )
      throw new GridAccessException();

    return sg;
  }
View Full Code Here

  public ICraftingGrid getCrafting() throws GridAccessException
  {
    IGrid grid = getGrid();
    if ( grid == null )
      throw new GridAccessException();

    ICraftingGrid sg = grid.getCache( ICraftingGrid.class );

    if ( sg == null )
      throw new GridAccessException();

    return sg;
  }
View Full Code Here

TOP

Related Classes of appeng.me.GridAccessException

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.