Class EnergyHandlerAdapter
java.lang.Object
net.neoforged.neoforge.energy.EnergyHandlerAdapter
- All Implemented Interfaces:
IEnergyStorage
@Deprecated(since="1.21.9",
forRemoval=true)
class EnergyHandlerAdapter
extends Object
implements IEnergyStorage
Deprecated, for removal: This API element is subject to removal in a future version.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final EnergyHandlerDeprecated, for removal: This API element is subject to removal in a future version. -
Constructor Summary
ConstructorsConstructorDescriptionEnergyHandlerAdapter(EnergyHandler handler) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated, for removal: This API element is subject to removal in a future version.Returns if this storage can have energy extracted.booleanDeprecated, for removal: This API element is subject to removal in a future version.Used to determine if this storage can receive energy.intextractEnergy(int toExtract, boolean simulate) Deprecated, for removal: This API element is subject to removal in a future version.Removes energy from the storage.intDeprecated, for removal: This API element is subject to removal in a future version.Returns the amount of energy currently stored.intDeprecated, for removal: This API element is subject to removal in a future version.Returns the maximum amount of energy that can be stored.intreceiveEnergy(int toReceive, boolean simulate) Deprecated, for removal: This API element is subject to removal in a future version.Adds energy to the storage.
-
Field Details
-
handler
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Constructor Details
-
EnergyHandlerAdapter
EnergyHandlerAdapter(EnergyHandler handler) Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
receiveEnergy
public int receiveEnergy(int toReceive, boolean simulate) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:IEnergyStorageAdds energy to the storage. Returns the amount of energy that was accepted.- Specified by:
receiveEnergyin interfaceIEnergyStorage- Parameters:
toReceive- The amount of energy being received.simulate- If true, the insertion will only be simulated, meaningIEnergyStorage.getEnergyStored()will not change.- Returns:
- Amount of energy that was (or would have been, if simulated) accepted by the storage.
-
extractEnergy
public int extractEnergy(int toExtract, boolean simulate) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:IEnergyStorageRemoves energy from the storage. Returns the amount of energy that was removed.- Specified by:
extractEnergyin interfaceIEnergyStorage- Parameters:
toExtract- The amount of energy being extracted.simulate- If true, the extraction will only be simulated, meaningIEnergyStorage.getEnergyStored()will not change.- Returns:
- Amount of energy that was (or would have been, if simulated) extracted from the storage.
-
getEnergyStored
public int getEnergyStored()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:IEnergyStorageReturns the amount of energy currently stored.- Specified by:
getEnergyStoredin interfaceIEnergyStorage
-
getMaxEnergyStored
public int getMaxEnergyStored()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:IEnergyStorageReturns the maximum amount of energy that can be stored.- Specified by:
getMaxEnergyStoredin interfaceIEnergyStorage
-
canExtract
public boolean canExtract()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:IEnergyStorageReturns if this storage can have energy extracted. If this is false, then any calls to extractEnergy will return 0.- Specified by:
canExtractin interfaceIEnergyStorage
-
canReceive
public boolean canReceive()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:IEnergyStorageUsed to determine if this storage can receive energy. If this is false, then any calls to receiveEnergy will return 0.- Specified by:
canReceivein interfaceIEnergyStorage
-