2014-02-16 19:41:45 +01:00
|
|
|
package appeng.integration.modules.helpers;
|
2014-02-15 07:40:02 +01:00
|
|
|
|
|
|
|
import net.minecraft.nbt.NBTTagCompound;
|
2014-02-16 19:41:45 +01:00
|
|
|
import appeng.integration.abstraction.helpers.BaseMJperdition;
|
2014-02-15 07:40:02 +01:00
|
|
|
import buildcraft.api.power.IPowerReceptor;
|
|
|
|
import buildcraft.api.power.PowerHandler;
|
|
|
|
import buildcraft.api.power.PowerHandler.PowerReceiver;
|
|
|
|
import buildcraft.api.power.PowerHandler.Type;
|
|
|
|
|
2014-02-16 19:41:45 +01:00
|
|
|
public class MJPerdition extends BaseMJperdition
|
2014-02-15 07:40:02 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
final protected PowerHandler bcPowerHandler;
|
|
|
|
|
2014-02-16 19:41:45 +01:00
|
|
|
public MJPerdition(IPowerReceptor te) {
|
2014-02-15 07:40:02 +01:00
|
|
|
bcPowerHandler = new PowerHandler( te, Type.MACHINE );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void Tick()
|
|
|
|
{
|
|
|
|
bcPowerHandler.update();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void writeToNBT(NBTTagCompound data)
|
|
|
|
{
|
|
|
|
bcPowerHandler.writeToNBT( data, "bcPowerHandler" );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void readFromNBT(NBTTagCompound data)
|
|
|
|
{
|
|
|
|
bcPowerHandler.readFromNBT( data, "bcPowerHandler" );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public PowerReceiver getPowerReceiver()
|
|
|
|
{
|
|
|
|
return bcPowerHandler.getPowerReceiver();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2014-05-11 23:13:37 +02:00
|
|
|
public double useEnergy(double min, double max, boolean doUse)
|
2014-02-15 07:40:02 +01:00
|
|
|
{
|
|
|
|
return bcPowerHandler.useEnergy( min, max, doUse );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void addEnergy(float failed)
|
|
|
|
{
|
|
|
|
bcPowerHandler.addEnergy( failed );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void configure(int i, int j, float f, int k)
|
|
|
|
{
|
|
|
|
bcPowerHandler.configure( i, j, f, k );
|
|
|
|
}
|
|
|
|
|
2014-01-28 21:40:47 +01:00
|
|
|
}
|