Class IngredientComponentStorageWrapperHandlerResourceHandler<C,R extends net.neoforged.neoforge.transfer.resource.Resource,T,M>
java.lang.Object
org.cyclops.commoncapabilities.ingredient.storage.IngredientComponentStorageWrapperHandlerResourceHandler<C,R,T,M>
- All Implemented Interfaces:
IIngredientComponentStorageWrapperHandler<T,M, net.neoforged.neoforge.transfer.ResourceHandler<R>, C>
- Direct Known Subclasses:
IngredientComponentStorageWrapperHandlerItemStack
public class IngredientComponentStorageWrapperHandlerResourceHandler<C,R extends net.neoforged.neoforge.transfer.resource.Resource,T,M>
extends Object
implements IIngredientComponentStorageWrapperHandler<T,M,net.neoforged.neoforge.transfer.ResourceHandler<R>,C>
Generic storage wrapper handler for
ResourceHandler.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classIngredientComponentStorageWrapperHandlerResourceHandler.ComponentStorageWrapper<R extends net.neoforged.neoforge.transfer.resource.Resource,T, M> static classIngredientComponentStorageWrapperHandlerResourceHandler.ResourceStorageWrapper<R extends net.neoforged.neoforge.transfer.resource.Resource,T, M> static classIngredientComponentStorageWrapperHandlerResourceHandler.ResourceStorageWrapperSlotted<R extends net.neoforged.neoforge.transfer.resource.Resource,T, M> -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionIngredientComponentStorageWrapperHandlerResourceHandler(IngredientComponent<T, M> ingredientComponent, net.neoforged.neoforge.capabilities.BaseCapability<? extends net.neoforged.neoforge.transfer.ResourceHandler<R>, C> capability, IResourceConverter<R, T> resourceConverter) -
Method Summary
Modifier and TypeMethodDescriptiongetStorage(ICapabilityGetter<C> capabilityProvider, C context) Get the storage within the given capability provider.wrapComponentStorage(net.neoforged.neoforge.transfer.ResourceHandler<R> storage) Wrap the given storage.net.neoforged.neoforge.transfer.ResourceHandler<R> wrapStorage(IIngredientComponentStorage<T, M> componentStorage) Wrap the given storage.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorageWrapperHandler
getComponentStorage
-
Field Details
-
resourceConverter
protected final IResourceConverter<R extends net.neoforged.neoforge.transfer.resource.Resource,T> resourceConverter
-
-
Constructor Details
-
IngredientComponentStorageWrapperHandlerResourceHandler
public IngredientComponentStorageWrapperHandlerResourceHandler(IngredientComponent<T, M> ingredientComponent, net.neoforged.neoforge.capabilities.BaseCapability<? extends net.neoforged.neoforge.transfer.ResourceHandler<R>, C> capability, IResourceConverter<R, T> resourceConverter)
-
-
Method Details
-
wrapComponentStorage
public IIngredientComponentStorage<T,M> wrapComponentStorage(net.neoforged.neoforge.transfer.ResourceHandler<R> storage) Description copied from interface:IIngredientComponentStorageWrapperHandlerWrap the given storage.- Specified by:
wrapComponentStoragein interfaceIIngredientComponentStorageWrapperHandler<C,R extends net.neoforged.neoforge.transfer.resource.Resource, T, M> - Parameters:
storage- The external storage to wrap.- Returns:
- A component storage.
-
wrapStorage
public net.neoforged.neoforge.transfer.ResourceHandler<R> wrapStorage(IIngredientComponentStorage<T, M> componentStorage) Description copied from interface:IIngredientComponentStorageWrapperHandlerWrap the given storage.- Specified by:
wrapStoragein interfaceIIngredientComponentStorageWrapperHandler<C,R extends net.neoforged.neoforge.transfer.resource.Resource, T, M> - Parameters:
componentStorage- The component storage to wrap.- Returns:
- A component storage.
-
getStorage
public Optional<net.neoforged.neoforge.transfer.ResourceHandler<R>> getStorage(ICapabilityGetter<C> capabilityProvider, @Nullable C context) Description copied from interface:IIngredientComponentStorageWrapperHandlerGet the storage within the given capability provider.- Specified by:
getStoragein interfaceIIngredientComponentStorageWrapperHandler<C,R extends net.neoforged.neoforge.transfer.resource.Resource, T, M> - 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:
getComponentin interfaceIIngredientComponentStorageWrapperHandler<C,R extends net.neoforged.neoforge.transfer.resource.Resource, T, M> - Returns:
- The ingredient component.
-