Class IngredientComponentStorageWrapperHandlerEnergyStorage<C>
java.lang.Object
org.cyclops.commoncapabilities.ingredient.storage.IngredientComponentStorageWrapperHandlerEnergyStorage<C>
- All Implemented Interfaces:
IIngredientComponentStorageWrapperHandler<Long,
Boolean, net.neoforged.neoforge.energy.IEnergyStorage, C>
public class IngredientComponentStorageWrapperHandlerEnergyStorage<C>
extends Object
implements IIngredientComponentStorageWrapperHandler<Long,Boolean,net.neoforged.neoforge.energy.IEnergyStorage,C>
Energy storage wrapper handler for
IEnergyStorage
.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
-
Constructor Summary
ConstructorDescriptionIngredientComponentStorageWrapperHandlerEnergyStorage
(IngredientComponent<Long, Boolean> ingredientComponent, net.neoforged.neoforge.capabilities.BaseCapability<net.neoforged.neoforge.energy.IEnergyStorage, C> capability) -
Method Summary
Modifier and TypeMethodDescriptionOptional
<net.neoforged.neoforge.energy.IEnergyStorage> getStorage
(ICapabilityGetter<C> capabilityProvider, C context) Get the storage within the given capability provider.wrapComponentStorage
(net.neoforged.neoforge.energy.IEnergyStorage storage) Wrap the given storage.net.neoforged.neoforge.energy.IEnergyStorage
wrapStorage
(IIngredientComponentStorage<Long, Boolean> componentStorage) Wrap the given storage.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorageWrapperHandler
getComponentStorage
-
Constructor Details
-
IngredientComponentStorageWrapperHandlerEnergyStorage
public IngredientComponentStorageWrapperHandlerEnergyStorage(IngredientComponent<Long, Boolean> ingredientComponent, net.neoforged.neoforge.capabilities.BaseCapability<net.neoforged.neoforge.energy.IEnergyStorage, C> capability)
-
-
Method Details
-
wrapComponentStorage
public IIngredientComponentStorage<Long,Boolean> wrapComponentStorage(net.neoforged.neoforge.energy.IEnergyStorage storage) Description copied from interface:IIngredientComponentStorageWrapperHandler
Wrap the given storage.- Specified by:
wrapComponentStorage
in interfaceIIngredientComponentStorageWrapperHandler<Long,
Boolean, net.neoforged.neoforge.energy.IEnergyStorage, C> - Parameters:
storage
- The external storage to wrap.- Returns:
- A component storage.
-
wrapStorage
public net.neoforged.neoforge.energy.IEnergyStorage wrapStorage(IIngredientComponentStorage<Long, Boolean> componentStorage) Description copied from interface:IIngredientComponentStorageWrapperHandler
Wrap the given storage.- Specified by:
wrapStorage
in interfaceIIngredientComponentStorageWrapperHandler<Long,
Boolean, net.neoforged.neoforge.energy.IEnergyStorage, C> - Parameters:
componentStorage
- The component storage to wrap.- Returns:
- A component storage.
-
getStorage
public Optional<net.neoforged.neoforge.energy.IEnergyStorage> getStorage(ICapabilityGetter<C> capabilityProvider, @Nullable C context) Description copied from interface:IIngredientComponentStorageWrapperHandler
Get the storage within the given capability provider.- Specified by:
getStorage
in interfaceIIngredientComponentStorageWrapperHandler<Long,
Boolean, net.neoforged.neoforge.energy.IEnergyStorage, C> - Parameters:
capabilityProvider
- A capability provider.context
- The context to get the storage with.- Returns:
- A storage, or null if it does not exist.
-
getComponent
- Specified by:
getComponent
in interfaceIIngredientComponentStorageWrapperHandler<Long,
Boolean, net.neoforged.neoforge.energy.IEnergyStorage, C> - Returns:
- The ingredient component.
-