Class InsertOnlyEnergyContainer
java.lang.Object
earth.terrarium.botarium.common.energy.impl.SimpleEnergyContainer
earth.terrarium.botarium.common.energy.impl.InsertOnlyEnergyContainer
- All Implemented Interfaces:
EnergyContainer,Serializable,net.minecraft.world.Clearable
-
Constructor Summary
ConstructorsConstructorDescriptionInsertOnlyEnergyContainer(long energyCapacity) InsertOnlyEnergyContainer(long maxCapacity, long maxInsert) -
Method Summary
Modifier and TypeMethodDescriptionbooleanlongextractEnergy(long maxAmount, boolean simulate) Extracts a given amount of energy into the container.longinternalExtract(long maxAmount, boolean simulate) An internal version ofEnergyContainer.extractEnergy(long, boolean)that is used by mod authors looking to directly interact with their own containers.longMethods inherited from class earth.terrarium.botarium.common.energy.impl.SimpleEnergyContainer
allowsInsertion, clearContent, createSnapshot, deserialize, getMaxCapacity, getStoredEnergy, insertEnergy, internalInsert, maxInsert, serialize, setEnergyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface earth.terrarium.botarium.common.energy.base.EnergyContainer
readSnapshot
-
Constructor Details
-
InsertOnlyEnergyContainer
public InsertOnlyEnergyContainer(long energyCapacity) -
InsertOnlyEnergyContainer
public InsertOnlyEnergyContainer(long maxCapacity, long maxInsert)
-
-
Method Details
-
maxExtract
public long maxExtract()- Specified by:
maxExtractin interfaceEnergyContainer- Overrides:
maxExtractin classSimpleEnergyContainer- Returns:
- The maximum amount of energy that can be extracted from the container at a time.
-
allowsExtraction
public boolean allowsExtraction()- Specified by:
allowsExtractionin interfaceEnergyContainer- Overrides:
allowsExtractionin classSimpleEnergyContainer- Returns:
- Whether the container allows for energy to be extracted.
-
extractEnergy
public long extractEnergy(long maxAmount, boolean simulate) Description copied from interface:EnergyContainerExtracts a given amount of energy into the container.- Specified by:
extractEnergyin interfaceEnergyContainer- Overrides:
extractEnergyin classSimpleEnergyContainer- Parameters:
maxAmount- The amount to be extracted from the container.simulate- If true, the container will not be modified.- Returns:
- The amount of energy that was removed from the container.
-
internalExtract
public long internalExtract(long maxAmount, boolean simulate) Description copied from interface:EnergyContainerAn internal version ofEnergyContainer.extractEnergy(long, boolean)that is used by mod authors looking to directly interact with their own containers.You should not call this method for other mod's containers, instead use
EnergyContainer.extractEnergy(long, boolean).- Specified by:
internalExtractin interfaceEnergyContainer- Overrides:
internalExtractin classSimpleEnergyContainer
-