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 Details

    • getComponent

      IngredientComponent<T,M> getComponent()
      Returns:
      The ingredient component.
    • wrapComponentStorage

      IIngredientComponentStorage<T,M> wrapComponentStorage(S storage)
      Wrap the given storage.
      Parameters:
      storage - The external storage to wrap.
      Returns:
      A component storage.
    • wrapStorage

      S wrapStorage(IIngredientComponentStorage<T,M> componentStorage)
      Wrap the given storage.
      Parameters:
      componentStorage - The component storage to wrap.
      Returns:
      A component storage.
    • getStorage

      Optional<S> getStorage(ICapabilityGetter<C> capabilityGetter, C context)
      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.