Package appeng.me.cache

Examples of appeng.me.cache.P2PCache


  {
    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


              PartP2PTunnel newTunnel = (PartP2PTunnel) newBus;
              newTunnel.output = true;

              try
              {
                P2PCache p2p = newTunnel.proxy.getP2P();
                p2p.updateFreq( newTunnel, freq );
              }
              catch (GridAccessException e)
              {
                // :P
              }

              newTunnel.onTunnelNetworkChange();
            }

            mc.notifyUser( player, MemoryCardMessages.SETTINGS_LOADED );
            return true;
          }
        }
      }
      mc.notifyUser( player, MemoryCardMessages.INVALID_MACHINE );
    }
    else if ( tt != null ) // attunement
    {
      ItemStack newType = null;

      switch (tt)
      {
      case LIGHT:
        newType = AEApi.instance().parts().partP2PTunnelLight.stack( 1 );
        break;

      case RF_POWER:
        newType = AEApi.instance().parts().partP2PTunnelRF.stack( 1 );
        break;

      case BC_POWER:
        newType = AEApi.instance().parts().partP2PTunnelMJ.stack( 1 );
        break;

      case FLUID:
        newType = AEApi.instance().parts().partP2PTunnelLiquids.stack( 1 );
        break;

      case IC2_POWER:
        newType = AEApi.instance().parts().partP2PTunnelEU.stack( 1 );
        break;

      case ITEM:
        newType = AEApi.instance().parts().partP2PTunnelItems.stack( 1 );
        break;

      case ME:
        newType = AEApi.instance().parts().partP2PTunnelME.stack( 1 );
        break;

      case REDSTONE:
        newType = AEApi.instance().parts().partP2PTunnelRedstone.stack( 1 );
        break;

      default:
        break;

      }

      if ( newType != null && !Platform.isSameItem( newType, this.is ) )
      {
        boolean oldOutput = output;
        long myFreq = freq;

        getHost().removePart( side, false );
        ForgeDirection dir = getHost().addPart( newType, side, player );
        IPart newBus = getHost().getPart( dir );

        if ( newBus instanceof PartP2PTunnel )
        {
          PartP2PTunnel newTunnel = (PartP2PTunnel) newBus;
          newTunnel.output = oldOutput;
          newTunnel.onTunnelNetworkChange();

          try
          {
            P2PCache p2p = newTunnel.proxy.getP2P();
            p2p.updateFreq( newTunnel, myFreq );
          }
          catch (GridAccessException e)
          {
            // :P
          }
View Full Code Here

TOP

Related Classes of appeng.me.cache.P2PCache

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.