Tabnine Logo
IEnergyGrid.isNetworkPowered
Code IndexAdd Tabnine to your IDE (free)

How to use
isNetworkPowered
method
in
appeng.api.networking.energy.IEnergyGrid

Best Java code snippets using appeng.api.networking.energy.IEnergyGrid.isNetworkPowered (Showing top 20 results out of 315)

origin: AppliedEnergistics/Applied-Energistics-2

private static boolean isPowered( final IGrid grid )
{
  if( grid == null )
  {
    return false;
  }
  final IEnergyGrid eg = grid.getCache( IEnergyGrid.class );
  return eg.isNetworkPowered();
}
origin: AppliedEnergistics/Applied-Energistics-2

public boolean isPowered()
{
  try
  {
    return this.getEnergy().isNetworkPowered();
  }
  catch( final GridAccessException e )
  {
    return false;
  }
}
origin: AppliedEnergistics/Applied-Energistics-2

public boolean isPowered()
{
  if( Platform.isClient() )
  {
    return ( this.constructed & this.powered ) == this.powered && this.constructed != -1;
  }
  try
  {
    return this.getProxy().getEnergy().isNetworkPowered();
  }
  catch( final GridAccessException e )
  {
    // :P
  }
  return false;
}
origin: AppliedEnergistics/Applied-Energistics-2

@Override
public boolean isPowered()
{
  if( Platform.isServer() )
  {
    try
    {
      return this.getProxy().getEnergy().isNetworkPowered();
    }
    catch( final GridAccessException e )
    {
      return false;
    }
  }
  return this.hasPower;
}
origin: AppliedEnergistics/Applied-Energistics-2

@Override
public final boolean isPowered()
{
  try
  {
    if( Platform.isServer() )
    {
      return this.getProxy().getEnergy().isNetworkPowered();
    }
    else
    {
      return( ( this.getClientFlags() & PartPanel.POWERED_FLAG ) == PartPanel.POWERED_FLAG );
    }
  }
  catch( final GridAccessException e )
  {
    return false;
  }
}
origin: AppliedEnergistics/Applied-Energistics-2

@Override
public void writeToStream( final ByteBuf data ) throws IOException
{
  super.writeToStream( data );
  try
  {
    data.writeBoolean( this.getProxy().getEnergy().isNetworkPowered() );
  }
  catch( final GridAccessException e )
  {
    data.writeBoolean( false );
  }
}
origin: AppliedEnergistics/Applied-Energistics-2

@Override
public boolean isActive()
{
  final IGrid g = this.getGrid();
  if( g != null )
  {
    final IPathingGrid pg = g.getCache( IPathingGrid.class );
    final IEnergyGrid eg = g.getCache( IEnergyGrid.class );
    return eg.isNetworkPowered() && !pg.isNetworkBooting() && this.meetsChannelRequirements();
  }
  return false;
}
origin: AppliedEnergistics/Applied-Energistics-2

@Override
public boolean isPowered()
{
  if( Platform.isClient() )
  {
    return ( this.state & 0x40 ) == 0x40;
  }
  boolean gridPowered = this.getAECurrentPower() > 64;
  if( !gridPowered )
  {
    try
    {
      gridPowered = this.getProxy().getEnergy().isNetworkPowered();
    }
    catch( final GridAccessException ignored )
    {
    }
  }
  return super.getAECurrentPower() > 1 || gridPowered;
}
origin: AppliedEnergistics/Applied-Energistics-2

protected void updatePowerStatus()
{
  try
  {
    if( this.networkNode != null )
    {
      this.setPowered( this.networkNode.isActive() );
    }
    else if( this.getPowerSource() instanceof IEnergyGrid )
    {
      this.setPowered( ( (IEnergyGrid) this.getPowerSource() ).isNetworkPowered() );
    }
    else
    {
      this.setPowered( this.getPowerSource().extractAEPower( 1, Actionable.SIMULATE, PowerMultiplier.CONFIG ) > 0.8 );
    }
  }
  catch( final Throwable t )
  {
    // :P
  }
}
origin: AppliedEnergistics/Applied-Energistics-2

protected boolean hasAccess( final SecurityPermissions perm, final boolean requirePower )
{
  final IActionHost host = this.getActionHost();
  if( host != null )
  {
    final IGridNode gn = host.getActionableNode();
    if( gn != null )
    {
      final IGrid g = gn.getGrid();
      if( g != null )
      {
        if( requirePower )
        {
          final IEnergyGrid eg = g.getCache( IEnergyGrid.class );
          if( !eg.isNetworkPowered() )
          {
            return false;
          }
        }
        final ISecurityGrid sg = g.getCache( ISecurityGrid.class );
        if( sg.hasPermission( this.getInventoryPlayer().player, perm ) )
        {
          return true;
        }
      }
    }
  }
  return false;
}
origin: AppliedEnergistics/Applied-Energistics-2

protected void updatePowerStatus()
{
  try
  {
    if( this.networkNode != null )
    {
      this.setPowered( this.networkNode.isActive() );
    }
    else if( this.getPowerSource() instanceof IEnergyGrid )
    {
      this.setPowered( ( (IEnergyGrid) this.getPowerSource() ).isNetworkPowered() );
    }
    else
    {
      this.setPowered( this.getPowerSource().extractAEPower( 1, Actionable.SIMULATE, PowerMultiplier.CONFIG ) > 0.8 );
    }
  }
  catch( final Exception ignore )
  {
    // :P
  }
}
origin: AppliedEnergistics/Applied-Energistics-2

@Override
public void writeToStream( final ByteBuf data ) throws IOException
{
  super.writeToStream( data );
  this.clientFlags = this.getSpin() & 3;
  try
  {
    if( this.getProxy().getEnergy().isNetworkPowered() )
    {
      this.clientFlags = this.getClientFlags() | AbstractPartReporting.POWERED_FLAG;
    }
    if( this.getProxy().getPath().isNetworkBooting() )
    {
      this.clientFlags = this.getClientFlags() | AbstractPartReporting.BOOTING_FLAG;
    }
    if( this.getProxy().getNode().meetsChannelRequirements() )
    {
      this.clientFlags = this.getClientFlags() | AbstractPartReporting.CHANNEL_FLAG;
    }
  }
  catch( final GridAccessException e )
  {
    // um.. nothing.
  }
  data.writeByte( (byte) this.getClientFlags() );
  data.writeInt( this.opacity );
}
origin: AppliedEnergistics/Applied-Energistics-2

@Override
protected void writeToStream( final ByteBuf data ) throws IOException
{
  super.writeToStream( data );
  this.setClientFlags( 0 );
  try
  {
    if( this.getProxy().getEnergy().isNetworkPowered() )
    {
      this.setClientFlags( this.getClientFlags() | POWERED_FLAG );
    }
    if( this.getProxy().getNode().meetsChannelRequirements() )
    {
      this.setClientFlags( this.getClientFlags() | CHANNEL_FLAG );
    }
  }
  catch( final GridAccessException e )
  {
    // meh
  }
  data.writeByte( (byte) this.getClientFlags() );
}
origin: AppliedEnergistics/Applied-Energistics-2

@Override
public void writeToStream( final ByteBuf data ) throws IOException
{
  super.writeToStream( data );
  this.setClientFlags( 0 );
  try
  {
    if( this.getProxy().getEnergy().isNetworkPowered() )
    {
      this.setClientFlags( this.getClientFlags() | POWERED_FLAG );
    }
    if( this.getProxy().getNode().meetsChannelRequirements() )
    {
      this.setClientFlags( this.getClientFlags() | CHANNEL_FLAG );
    }
    this.setClientFlags( this.populateFlags( this.getClientFlags() ) );
  }
  catch( final GridAccessException e )
  {
    // meh
  }
  data.writeByte( (byte) this.getClientFlags() );
}
origin: AppliedEnergistics/Applied-Energistics-2

if( this.getProxy().getEnergy().isNetworkPowered() )
origin: AppliedEnergistics/Applied-Energistics-2

if( !this.getProxy().getEnergy().isNetworkPowered() )
origin: AppliedEnergistics/Applied-Energistics-2

private void updateMeta()
{
  if( !this.getProxy().isReady() )
  {
    return;
  }
  ControllerBlockState metaState = ControllerBlockState.offline;
  try
  {
    if( this.getProxy().getEnergy().isNetworkPowered() )
    {
      metaState = ControllerBlockState.online;
      if( this.getProxy().getPath().getControllerState() == ControllerState.CONTROLLER_CONFLICT )
      {
        metaState = ControllerBlockState.conflicted;
      }
    }
  }
  catch( final GridAccessException e )
  {
    metaState = ControllerBlockState.offline;
  }
  if( this.checkController( this.pos ) && this.world.getBlockState( this.pos ).getValue( BlockController.CONTROLLER_STATE ) != metaState )
  {
    this.world.setBlockState( this.pos, this.world.getBlockState( this.pos ).withProperty( BlockController.CONTROLLER_STATE, metaState ) );
  }
}
origin: AppliedEnergistics/Applied-Energistics-2

if( this.getProxy().getEnergy().isNetworkPowered() )
origin: AppliedEnergistics/Applied-Energistics-2

if( !this.getProxy().getEnergy().isNetworkPowered() )
origin: Nividica/ThaumicEnergistics

@MENetworkEventSubscribe
public void updatePowerStatus(MENetworkPowerStatusChange event) {
  try {
    this.isPowered = GridUtil.getEnergyGrid(this).isNetworkPowered();
  } catch (GridAccessException e) {
    // should ignore?
    this.isPowered = false;
  }
}
appeng.api.networking.energyIEnergyGridisNetworkPowered

Popular methods of IEnergyGrid

  • getAvgPowerUsage
  • getStoredPower
  • extractAEPower
  • getAvgPowerInjection
  • getEnergyDemand
  • getMaxStoredPower
  • injectPower

Popular in Java

  • Finding current android device location
  • onRequestPermissionsResult (Fragment)
  • onCreateOptionsMenu (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now