make it runnable
This commit is contained in:
@@ -19,44 +19,38 @@
|
||||
package appeng.tile.powersink;
|
||||
|
||||
|
||||
import cofh.api.energy.IEnergyReceiver;
|
||||
import appeng.api.config.PowerUnits;
|
||||
import appeng.api.util.ForgeDirection;
|
||||
import appeng.transformer.annotations.Integration.Interface;
|
||||
|
||||
|
||||
@Interface( iname = "RF", iface = "cofh.api.energy.IEnergyReceiver" )
|
||||
public abstract class RedstoneFlux extends RotaryCraft implements IEnergyReceiver
|
||||
{
|
||||
@Override
|
||||
public final int receiveEnergy( ForgeDirection from, int maxReceive, boolean simulate )
|
||||
{
|
||||
final int networkRFDemand = (int) Math.floor( this.getExternalPowerDemand( PowerUnits.RF, maxReceive ) );
|
||||
final int usedRF = Math.min( maxReceive, networkRFDemand );
|
||||
|
||||
if( !simulate )
|
||||
{
|
||||
this.injectExternalPower( PowerUnits.RF, usedRF );
|
||||
}
|
||||
|
||||
return usedRF;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int getEnergyStored( ForgeDirection from )
|
||||
{
|
||||
return (int) Math.floor( PowerUnits.AE.convertTo( PowerUnits.RF, this.getAECurrentPower() ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int getMaxEnergyStored( ForgeDirection from )
|
||||
{
|
||||
return (int) Math.floor( PowerUnits.AE.convertTo( PowerUnits.RF, this.getAEMaxPower() ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean canConnectEnergy( ForgeDirection from )
|
||||
{
|
||||
return this.getPowerSides().contains( from );
|
||||
}
|
||||
}
|
||||
//@Interface( iname = "RF", iface = "cofh.api.energy.IEnergyReceiver" )
|
||||
//public abstract class RedstoneFlux extends RotaryCraft implements IEnergyReceiver
|
||||
//{
|
||||
// @Override
|
||||
// public final int receiveEnergy( ForgeDirection from, int maxReceive, boolean simulate )
|
||||
// {
|
||||
// final int networkRFDemand = (int) Math.floor( this.getExternalPowerDemand( PowerUnits.RF, maxReceive ) );
|
||||
// final int usedRF = Math.min( maxReceive, networkRFDemand );
|
||||
//
|
||||
// if( !simulate )
|
||||
// {
|
||||
// this.injectExternalPower( PowerUnits.RF, usedRF );
|
||||
// }
|
||||
//
|
||||
// return usedRF;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public final int getEnergyStored( ForgeDirection from )
|
||||
// {
|
||||
// return (int) Math.floor( PowerUnits.AE.convertTo( PowerUnits.RF, this.getAECurrentPower() ) );
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public final int getMaxEnergyStored( ForgeDirection from )
|
||||
// {
|
||||
// return (int) Math.floor( PowerUnits.AE.convertTo( PowerUnits.RF, this.getAEMaxPower() ) );
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public final boolean canConnectEnergy( ForgeDirection from )
|
||||
// {
|
||||
// return this.getPowerSides().contains( from );
|
||||
// }
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user