Interface IIngredientComponentStorageWrapperHandler<T,M,S,C>
- Type Parameters:
T
- The instance type.M
- The matching condition parameter, may be Void. Instances MUST properly implement the equals method.S
- The external storage type.
- All Known Implementing Classes:
IngredientComponentStorageWrapperHandlerEnergyStorage
,IngredientComponentStorageWrapperHandlerFluidStack
,IngredientComponentStorageWrapperHandlerItemStack
,IngredientComponentStorageWrapperHandlerItemStackSlotless
public interface IIngredientComponentStorageWrapperHandler<T,M,S,C>
A handler for wrapping external storage interfaces into
IIngredientComponentStorage
and the other way (IIngredientComponentStorage
into external storage interfaces).-
Method Summary
Modifier and TypeMethodDescriptiondefault IIngredientComponentStorage
<T, M> getComponentStorage
(ICapabilityGetter<C> capabilityGetter, C context) Get the ingredient storage within the given capability provider.getStorage
(ICapabilityGetter<C> capabilityGetter, C context) Get the storage within the given capability provider.wrapComponentStorage
(S storage) Wrap the given storage.wrapStorage
(IIngredientComponentStorage<T, M> componentStorage) Wrap the given storage.
-
Method Details
-
getComponent
IngredientComponent<T,M> getComponent()- Returns:
- The ingredient component.
-
wrapComponentStorage
Wrap the given storage.- Parameters:
storage
- The external storage to wrap.- Returns:
- A component storage.
-
wrapStorage
Wrap the given storage.- Parameters:
componentStorage
- The component storage to wrap.- Returns:
- A component storage.
-
getStorage
Get the storage within the given capability provider.- Parameters:
capabilityGetter
- A capability provider.context
- The context to get the storage with.- Returns:
- A storage, or null if it does not exist.
-
getComponentStorage
default IIngredientComponentStorage<T,M> getComponentStorage(ICapabilityGetter<C> capabilityGetter, C context) Get the ingredient storage within the given capability provider.- Parameters:
capabilityGetter
- A capability provider.context
- The context to get the storage with.- Returns:
- An ingredient storage, or null if it does not exist.
-