2014-05-10 04:08:56 +02:00
|
|
|
package appeng.tile.powersink;
|
|
|
|
|
|
|
|
import appeng.api.config.PowerUnits;
|
|
|
|
import appeng.transformer.annotations.integration.Interface;
|
|
|
|
import appeng.transformer.annotations.integration.InterfaceList;
|
|
|
|
import appeng.transformer.annotations.integration.Method;
|
|
|
|
import buildcraft.api.mj.IBatteryObject;
|
|
|
|
import buildcraft.api.mj.IBatteryProvider;
|
|
|
|
|
|
|
|
@InterfaceList(value = { @Interface(iname = "MJ6", iface = "buildcraft.api.mj.IBatteryProvider"),
|
|
|
|
@Interface(iname = "MJ6", iface = "buildcraft.api.mj.IBatteryObject") })
|
2014-05-11 23:13:37 +02:00
|
|
|
public abstract class MinecraftJoules6 extends MinecraftJoules5 implements IBatteryProvider, IBatteryObject
|
2014-05-10 04:08:56 +02:00
|
|
|
{
|
|
|
|
|
2014-05-11 23:13:37 +02:00
|
|
|
@Override
|
|
|
|
@Method(iname = "MJ6")
|
|
|
|
public String kind()
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2014-05-10 04:08:56 +02:00
|
|
|
@Override
|
|
|
|
@Method(iname = "MJ6")
|
|
|
|
public double getEnergyRequested()
|
|
|
|
{
|
2014-06-04 03:33:04 +02:00
|
|
|
return getExternalPowerDemand( PowerUnits.MJ, Double.MAX_VALUE );
|
2014-05-10 04:08:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Method(iname = "MJ6")
|
|
|
|
public double addEnergy(double amount)
|
|
|
|
{
|
2014-05-11 23:13:37 +02:00
|
|
|
double overflow = injectExternalPower( PowerUnits.MJ, amount );
|
2014-05-10 04:08:56 +02:00
|
|
|
return amount - overflow;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Method(iname = "MJ6")
|
|
|
|
public double addEnergy(double amount, boolean ignoreCycleLimit)
|
|
|
|
{
|
2014-05-11 23:13:37 +02:00
|
|
|
double overflow = injectExternalPower( PowerUnits.MJ, amount );
|
2014-05-10 04:08:56 +02:00
|
|
|
return amount - overflow;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Method(iname = "MJ6")
|
|
|
|
public double getEnergyStored()
|
|
|
|
{
|
|
|
|
return PowerUnits.AE.convertTo( PowerUnits.MJ, internalCurrentPower );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Method(iname = "MJ6")
|
|
|
|
public void setEnergyStored(double mj)
|
|
|
|
{
|
|
|
|
internalCurrentPower = PowerUnits.MJ.convertTo( PowerUnits.AE, mj );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Method(iname = "MJ6")
|
|
|
|
public double maxCapacity()
|
|
|
|
{
|
|
|
|
return PowerUnits.AE.convertTo( PowerUnits.MJ, internalMaxPower );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Method(iname = "MJ6")
|
|
|
|
public double minimumConsumption()
|
|
|
|
{
|
|
|
|
return 0.1;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Method(iname = "MJ6")
|
|
|
|
public double maxReceivedPerCycle()
|
|
|
|
{
|
|
|
|
return 999999.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Method(iname = "MJ6")
|
|
|
|
public IBatteryObject reconfigure(double maxCapacity, double maxReceivedPerCycle, double minimumConsumption)
|
|
|
|
{
|
2014-05-11 23:13:37 +02:00
|
|
|
return getMjBattery( "" );
|
2014-05-10 04:08:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Method(iname = "MJ6")
|
2014-05-11 23:13:37 +02:00
|
|
|
public IBatteryObject getMjBattery(String kind)
|
2014-05-10 04:08:56 +02:00
|
|
|
{
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|