Interface IIngredientComponentStorageWrapperHandler<T,M,S>
- 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.
public interface IIngredientComponentStorageWrapperHandler<T,M,S>
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
(net.minecraftforge.common.capabilities.ICapabilityProvider capabilityProvider, net.minecraft.core.Direction facing) Get the ingredient storage within the given capability provider.net.minecraftforge.common.util.LazyOptional<S>
getStorage
(net.minecraftforge.common.capabilities.ICapabilityProvider capabilityProvider, net.minecraft.core.Direction facing) 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
net.minecraftforge.common.util.LazyOptional<S> getStorage(net.minecraftforge.common.capabilities.ICapabilityProvider capabilityProvider, @Nullable net.minecraft.core.Direction facing) Get the storage within the given capability provider.- Parameters:
capabilityProvider
- A capability provider.facing
- The side to get the storage from.- Returns:
- A storage, or null if it does not exist.
-
getComponentStorage
default IIngredientComponentStorage<T,M> getComponentStorage(net.minecraftforge.common.capabilities.ICapabilityProvider capabilityProvider, @Nullable net.minecraft.core.Direction facing) Get the ingredient storage within the given capability provider.- Parameters:
capabilityProvider
- A capability provider.facing
- The side to get the storage from.- Returns:
- An ingredient storage, or null if it does not exist.
-