public class BatteryObject extends java.lang.Object implements IBatteryIOObject
| Modifier and Type | Field and Description |
|---|---|
protected MjBattery |
batteryData |
protected java.lang.reflect.Field |
energyStored |
protected java.lang.Object |
obj |
| Constructor and Description |
|---|
BatteryObject() |
| Modifier and Type | Method and Description |
|---|---|
double |
addEnergy(double mj)
Add energy to this battery
|
double |
addEnergy(double mj,
boolean ignoreCycleLimit)
Add energy to this battery
|
boolean |
canReceive() |
boolean |
canSend() |
double |
getEnergyRequested() |
double |
getEnergyStored() |
java.lang.String |
kind() |
double |
maxCapacity()
Can be overrided via
IBatteryObject.reconfigure(double, double, double) |
double |
maxReceivedPerCycle()
Can be overrided via
IBatteryObject.reconfigure(double, double, double) |
double |
minimumConsumption()
Can be overrided via
IBatteryObject.reconfigure(double, double, double) |
IOMode |
mode() |
void |
overrideBattery(double maxCapacity,
double maxReceivedPerCycle,
double minimumConsumption,
java.lang.String kind,
net.minecraftforge.common.util.ForgeDirection[] sides,
IOMode mode) |
BatteryObject |
reconfigure(double maxCapacity,
double maxReceivedPerCycle,
double minimumConsumption)
Allow to dynamically reconfigure your battery.
|
void |
setEnergyStored(double mj)
Set current stored energy amount.
|
protected java.lang.reflect.Field energyStored
protected java.lang.Object obj
protected MjBattery batteryData
public double getEnergyRequested()
getEnergyRequested in interface IBatteryObjectpublic double addEnergy(double mj)
addEnergy in interface IBatteryObjectmj - Energy amountpublic double addEnergy(double mj,
boolean ignoreCycleLimit)
addEnergy in interface IBatteryObjectmj - Energy amountignoreCycleLimit - Force add all energy even if "maxReceivedPerCycle" limit is reachedpublic double getEnergyStored()
getEnergyStored in interface IBatteryObjectpublic void setEnergyStored(double mj)
setEnergyStored in interface IBatteryObjectmj - New energy amountpublic double maxCapacity()
IBatteryObject.reconfigure(double, double, double)maxCapacity in interface IBatteryObjectpublic double minimumConsumption()
IBatteryObject.reconfigure(double, double, double)minimumConsumption in interface IBatteryObjectpublic double maxReceivedPerCycle()
IBatteryObject.reconfigure(double, double, double)maxReceivedPerCycle in interface IBatteryObjectpublic BatteryObject reconfigure(double maxCapacity, double maxReceivedPerCycle, double minimumConsumption)
reconfigure in interface IBatteryObjectmaxCapacity - IBatteryObject.maxCapacity()maxReceivedPerCycle - IBatteryObject.maxReceivedPerCycle()minimumConsumption - IBatteryObject.minimumConsumption()public void overrideBattery(double maxCapacity,
double maxReceivedPerCycle,
double minimumConsumption,
java.lang.String kind,
net.minecraftforge.common.util.ForgeDirection[] sides,
IOMode mode)
public java.lang.String kind()
kind in interface IBatteryObjectpublic IOMode mode()
mode in interface IBatteryIOObjectpublic boolean canSend()
canSend in interface IBatteryIOObjectpublic boolean canReceive()
canReceive in interface IBatteryIOObject