Class ExtractOnlyEnergyContainer
java.lang.Object
earth.terrarium.botarium.common.energy.impl.SimpleEnergyContainer
earth.terrarium.botarium.common.energy.impl.ExtractOnlyEnergyContainer
- All Implemented Interfaces:
EnergyContainer,Serializable,net.minecraft.world.Clearable
-
Constructor Summary
ConstructorsConstructorDescriptionExtractOnlyEnergyContainer(long energyCapacity) ExtractOnlyEnergyContainer(long maxCapacity, long maxExtract) -
Method Summary
Modifier and TypeMethodDescriptionbooleanlonginsertEnergy(long maxAmount, boolean simulate) Inserts a given amount of energy into the container.longinternalInsert(long maxAmount, boolean simulate) An internal version ofEnergyContainer.insertEnergy(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
allowsExtraction, clearContent, createSnapshot, deserialize, extractEnergy, getMaxCapacity, getStoredEnergy, internalExtract, maxExtract, 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
-
ExtractOnlyEnergyContainer
public ExtractOnlyEnergyContainer(long energyCapacity) -
ExtractOnlyEnergyContainer
public ExtractOnlyEnergyContainer(long maxCapacity, long maxExtract)
-
-
Method Details
-
maxInsert
public long maxInsert()- Specified by:
maxInsertin interfaceEnergyContainer- Overrides:
maxInsertin classSimpleEnergyContainer- Returns:
- The maximum amount of energy that can be inserted into the container at a time.
-
allowsInsertion
public boolean allowsInsertion()- Specified by:
allowsInsertionin interfaceEnergyContainer- Overrides:
allowsInsertionin classSimpleEnergyContainer- Returns:
- Whether the container allows for energy to be inserted.
-
insertEnergy
public long insertEnergy(long maxAmount, boolean simulate) Description copied from interface:EnergyContainerInserts a given amount of energy into the container.- Specified by:
insertEnergyin interfaceEnergyContainer- Overrides:
insertEnergyin classSimpleEnergyContainer- Parameters:
maxAmount- The amount to be inserted into the container.simulate- If true, the container will not be modified.- Returns:
- The amount of energy that was added to the container.
-
internalInsert
public long internalInsert(long maxAmount, boolean simulate) Description copied from interface:EnergyContainerAn internal version ofEnergyContainer.insertEnergy(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.insertEnergy(long, boolean).- Specified by:
internalInsertin interfaceEnergyContainer- Overrides:
internalInsertin classSimpleEnergyContainer
-