Package appeng.api.parts

Examples of appeng.api.parts.IPart


{

  @Override
  public IStorageMonitorable getMonitorable(ForgeDirection side, BaseActionSource src)
  {
    IPart part = getPart( side );
    if ( part instanceof ITileStorageMonitorable )
      return ((ITileStorageMonitorable) part).getMonitorable( side, src );
    return null;
  }
View Full Code Here


      return false;

    int interested = 0;
    for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
    {
      IPart part = getPart( dir );
      if ( part instanceof IEnergyTile )
      {
        interested++;
      }
    }
View Full Code Here

  public boolean emitsEnergyTo(TileEntity receiver, ForgeDirection direction)
  {
    if ( !isInIC2() )
      return false;

    IPart part = getPart( direction );
    if ( part instanceof IEnergySink )
      return ((IEnergyEmitter) part).emitsEnergyTo( receiver, direction );
    return false;
  }
View Full Code Here

    // this is a flawed implementation, that requires a change to the IC2 API.

    for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
    {
      IPart part = getPart( dir );
      if ( part instanceof IEnergySource )
      {
        // use lower number cause ic2 deletes power it sends that isn't received.
        return ((IEnergySource) part).getOfferedEnergy();
      }
View Full Code Here

  {
    // this is a flawed implementation, that requires a change to the IC2 API.

    for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
    {
      IPart part = getPart( dir );
      if ( part instanceof IEnergySource )
      {
        ((IEnergySource) part).drawEnergy( amount );
        return;
      }
View Full Code Here

  {
    // this is a flawed implementation, that requires a change to the IC2 API.

    for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
    {
      IPart part = getPart( dir );
      if ( part instanceof IEnergySource )
      {
        return ((IEnergySource) part).getSourceTier();
      }
    }
View Full Code Here

{

  @Override
  public ConnectOverride overridePipeConnection(PipeType type, ForgeDirection with)
  {
    IPart part = getPart( with );
    if ( part instanceof IPipeConnection )
      return ((IPipeConnection) part).overridePipeConnection( type, with );
    return ConnectOverride.DEFAULT;
  }
View Full Code Here

  static final FluidTankInfo[] emptyList = new FluidTankInfo[0];

  @Override
  public int fill(ForgeDirection from, FluidStack resource, boolean doFill)
  {
    IPart part = getPart( from );
    if ( part instanceof IFluidHandler )
      return ((IFluidHandler) part).fill( from, resource, doFill );
    return 0;
  }
View Full Code Here

  }

  @Override
  public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain)
  {
    IPart part = getPart( from );
    if ( part instanceof IFluidHandler )
      return ((IFluidHandler) part).drain( from, resource, doDrain );
    return null;
  }
View Full Code Here

  }

  @Override
  public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain)
  {
    IPart part = getPart( from );
    if ( part instanceof IFluidHandler )
      return ((IFluidHandler) part).drain( from, maxDrain, doDrain );
    return null;
  }
View Full Code Here

TOP

Related Classes of appeng.api.parts.IPart

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.