public class RFBattery extends java.lang.Object implements IEnergyStorage
| Constructor and Description |
|---|
RFBattery(int maxEnergy,
int maxReceive,
int maxExtract) |
| Modifier and Type | Method and Description |
|---|---|
int |
addEnergy(int minReceive,
int maxReceive,
boolean simulate) |
int |
extractEnergy(int maxExtract,
boolean simulate)
Removes energy from the storage.
|
int |
getEnergyStored()
Returns the amount of energy currently stored.
|
int |
getMaxEnergyExtract() |
int |
getMaxEnergyReceive() |
int |
getMaxEnergyStored()
Returns the maximum amount of energy that can be stored.
|
void |
readFromNBT(net.minecraft.nbt.NBTTagCompound tag) |
int |
receiveEnergy(int maxReceive,
boolean simulate)
Adds energy to the storage.
|
void |
setEnergy(int iEnergy) |
int |
useEnergy(int minExtract,
int maxExtract,
boolean simulate) |
void |
writeToNBT(net.minecraft.nbt.NBTTagCompound tag) |
public void readFromNBT(net.minecraft.nbt.NBTTagCompound tag)
public void writeToNBT(net.minecraft.nbt.NBTTagCompound tag)
public int addEnergy(int minReceive,
int maxReceive,
boolean simulate)
public int useEnergy(int minExtract,
int maxExtract,
boolean simulate)
public int receiveEnergy(int maxReceive,
boolean simulate)
IEnergyStoragereceiveEnergy in interface IEnergyStoragemaxReceive - Maximum amount of energy to be inserted.simulate - If TRUE, the insertion will only be simulated.public int extractEnergy(int maxExtract,
boolean simulate)
IEnergyStorageextractEnergy in interface IEnergyStoragemaxExtract - Maximum amount of energy to be extracted.simulate - If TRUE, the extraction will only be simulated.public int getEnergyStored()
IEnergyStoragegetEnergyStored in interface IEnergyStoragepublic int getMaxEnergyStored()
IEnergyStoragegetMaxEnergyStored in interface IEnergyStoragepublic int getMaxEnergyReceive()
public int getMaxEnergyExtract()
public void setEnergy(int iEnergy)