Package appeng.api.networking

Examples of appeng.api.networking.IGridBlock


        for (Class<? extends IGridHost> machineClass : network.getMachinesClasses())
        {
          IItemList<IAEItemStack> list = AEApi.instance().storage().createItemList();
          for (IGridNode machine : network.getMachines( machineClass ))
          {
            IGridBlock blk = machine.getGridBlock();
            ItemStack is = blk.getMachineRepresentation();
            if ( is != null && is.getItem() != null )
            {
              IAEItemStack ais = AEItemStack.create( is );
              ais.setStackSize( 1 );
              ais.setCountRequestable( (long) (blk.getIdlePowerUsage() * 100.0) );
              list.add( ais );
            }
          }

          for (IAEItemStack ais : list)
View Full Code Here


  @MENetworkEventSubscribe
  public void EnergyNodeChanges(MENetworkPowerIdleChange ev)
  {
    // update power usage based on event.
    GridNode node = (GridNode) ev.node;
    IGridBlock gb = node.getGridBlock();

    double newDraw = gb.getIdlePowerUsage();
    double diffDraw = newDraw - node.previousDraw;
    node.previousDraw = newDraw;

    drainPerTick += diffDraw;
  }
View Full Code Here

    if ( machine instanceof IEnergyGridProvider )
      energyGridProviders.add( (IEnergyGridProvider) machine );

    // idle draw...
    GridNode gridNode = (GridNode) node;
    IGridBlock gb = gridNode.getGridBlock();
    gridNode.previousDraw = gb.getIdlePowerUsage();
    drainPerTick += gridNode.previousDraw;

    // power storage
    if ( machine instanceof IAEPowerStorage )
    {
View Full Code Here

    for (IGridNode nodes : requireChannels)
    {
      if ( !semiOpen.contains( nodes ) )
      {
        IGridBlock gb = nodes.getGridBlock();
        EnumSet<GridFlags> flags = gb.getFlags();

        if ( flags.contains( GridFlags.COMPRESSED_CHANNEL ) && !blockDense.isEmpty() )
          return 9;

        depth++;
View Full Code Here

TOP

Related Classes of appeng.api.networking.IGridBlock

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.