Package appeng.api.networking

Examples of appeng.api.networking.IGrid


    return pg;
  }

  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


    return sg;
  }

  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

    if ( node != null )
    {
      try
      {
        IGrid g = getGrid();
        g.postEvent( new MENetworkPowerIdleChange( node ) );
      }
      catch (GridAccessException e)
      {
        // not ready for this yet..
      }
View Full Code Here

    // handle loading grid storages.
    if ( gridNode.getGridStorage() != null )
    {
      GridStorage gs = gridNode.getGridStorage();
      IGrid grid = gs.getGrid();

      if ( grid == null )
      {
        myStorage = gs;
        myStorage.setGrid( this );
View Full Code Here

          ForgeDirection sideOff = ForgeDirection.getOrientation( src_side );
          ForgeDirection currentSideOff = ForgeDirection.getOrientation( side );
          IGridNode n = gh.getGridNode( sideOff );
          if ( n != null )
          {
            IGrid g = n.getGrid();
            if ( g != null )
            {
              ISpatialCache sc = g.getCache( ISpatialCache.class );
              if ( sc.isValidRegion() )
              {
                DimensionalCoord min = sc.getMin();
                DimensionalCoord max = sc.getMax();
View Full Code Here

    for (TileCraftingTile r : tiles)
    {
      IGridNode n = r.getActionableNode();
      if ( n != null && !posted )
      {
        IGrid g = n.getGrid();
        if ( g != null )
        {
          g.postEvent( new MENetworkCraftingCpuChange( n ) );
          posted = true;
        }
      }

      r.updateStatus( null );
View Full Code Here

    for (TileCraftingTile r : tiles)
    {
      IGridNode gn = r.getActionableNode();
      if ( gn != null )
      {
        IGrid g = gn.getGrid();
        if ( g != null )
          return r.getActionableNode().getGrid();
      }
    }
View Full Code Here

    }
  }

  private void storeItems()
  {
    IGrid g = getGrid();
    if ( g == null )
      return;

    IStorageGrid sg = g.getCache( IStorageGrid.class );
    IMEInventory<IAEItemStack> ii = sg.getItemInventory();

    for (IAEItemStack is : inventory.getItemList())
    {
      is = inventory.extractItems( is.copy(), Actionable.MODULATE, machineSrc );
View Full Code Here

  {

    ItemStack cell = getStackInSlot( 0 );
    if ( isSpatialCell( cell ) && getStackInSlot( 1 ) == null )
    {
      IGrid gi = gridProxy.getGrid();
      IEnergyGrid energy = gridProxy.getEnergy();

      ISpatialStorageCell sc = (ISpatialStorageCell) cell.getItem();

      SpatialPylonCache spc = gi.getCache( ISpatialCache.class );
      if ( spc.hasRegion() && spc.isValidRegion() )
      {
        double req = spc.requiredPower();
        double pr = energy.extractAEPower( req, Actionable.SIMULATE, PowerMultiplier.CONFIG );
        if ( Math.abs( pr - req ) < req * 0.001 )
        {
          MENetworkEvent res = gi.postEvent( new MENetworkSpatialEvent( this, req ) );
          if ( !res.isCanceled() )
          {
            TransitionResult tr = sc.doSpatialTransition( cell, worldObj, spc.getMin(), spc.getMax(), true );
            if ( tr.success )
            {
View Full Code Here

    {
      IContainerCraftingPacket cct = (IContainerCraftingPacket) con;
      IGridNode node = cct.getNetworkNode();
      if ( node != null )
      {
        IGrid grid = node.getGrid();
        if ( grid == null )
          return;

        IStorageGrid inv = grid.getCache( IStorageGrid.class );
        IEnergyGrid energy = grid.getCache( IEnergyGrid.class );
        ISecurityGrid security = grid.getCache( ISecurityGrid.class );
        IInventory craftMatrix = cct.getInventoryByName( "crafting" );

        Actionable realForFake = cct.useRealItems() ? Actionable.MODULATE : Actionable.SIMULATE;

        if ( inv != null && recipe != null && security != null )
View Full Code Here

TOP

Related Classes of appeng.api.networking.IGrid

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.