Applied-Energistics-2-tiler.../integration/modules/helpers/MJPerdition.java
2014-05-11 16:13:37 -05:00

61 lines
No EOL
1.3 KiB
Java

package appeng.integration.modules.helpers;
import net.minecraft.nbt.NBTTagCompound;
import appeng.integration.abstraction.helpers.BaseMJperdition;
import buildcraft.api.power.IPowerReceptor;
import buildcraft.api.power.PowerHandler;
import buildcraft.api.power.PowerHandler.PowerReceiver;
import buildcraft.api.power.PowerHandler.Type;
public class MJPerdition extends BaseMJperdition
{
final protected PowerHandler bcPowerHandler;
public MJPerdition(IPowerReceptor te) {
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
public double useEnergy(double min, double max, boolean doUse)
{
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 );
}
}