make it runnable

This commit is contained in:
thatsIch
2015-06-17 19:39:18 +02:00
parent 38afde724b
commit a95b9962b9
17 changed files with 1422 additions and 1583 deletions
@@ -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 );
// }
//}