IEnergyStorage
Importing the class
If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.
import crafttweaker.api.capability.IEnergyStorage;
Members
Getter
Checks if energy can be extracted from this storage.script.zs
// IEnergyStorage.canExtract as boolmyIEnergyStorage.canExtract
Return Type:
bool
Getter
Checks if this storage can receive energy.script.zs
// IEnergyStorage.canReceive as boolmyIEnergyStorage.canReceive
Return Type:
bool
Getter
Gets the amount of energy stored.script.zs
// IEnergyStorage.energyStored as intmyIEnergyStorage.energyStored
Return Type:
int
extractEnergy(maxExtract as int, simulate as bool) as int
Extracts energy from the storage.script.zs
Returns: the amount of energy that was extracted.
// IEnergyStorage.extractEnergy(maxExtract as int, simulate as bool) as int;myIEnergyStorage.extractEnergy(400, false);
Parameters:
maxExtract: int
Type: int
- The max amount of energy to be extracted. simulate: bool
Type: bool
- If the energy should actually be extracted or not.
Return Type:
int
Getter
Gets the max energy that can be stored.script.zs
// IEnergyStorage.maxEnergyStored as intmyIEnergyStorage.maxEnergyStored
Return Type:
int
receiveEnergy(maxReceive as int, simulate as bool) as int
Adds energy to the storage.script.zs
Returns: the amount of energy that was accepted.
// IEnergyStorage.receiveEnergy(maxReceive as int, simulate as bool) as int;myIEnergyStorage.receiveEnergy(300, false);
Parameters:
maxReceive: int
Type: int
- The max amount of energy to be inserted. simulate: bool
Type: bool
- If the energy should actually be inserted or not.
Return Type:
int