Class IngredientComponentStorageWrapperHandlerItemStack<C>
java.lang.Object
org.cyclops.commoncapabilities.ingredient.storage.IngredientComponentStorageWrapperHandlerItemStack<C>
- All Implemented Interfaces:
IIngredientComponentStorageWrapperHandler<net.minecraft.world.item.ItemStack,
Integer, net.neoforged.neoforge.items.IItemHandler, C>
public class IngredientComponentStorageWrapperHandlerItemStack<C>
extends Object
implements IIngredientComponentStorageWrapperHandler<net.minecraft.world.item.ItemStack,Integer,net.neoforged.neoforge.items.IItemHandler,C>
Item storage wrapper handler for
IItemHandler
.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
static class
-
Constructor Summary
ConstructorDescriptionIngredientComponentStorageWrapperHandlerItemStack
(IngredientComponent<net.minecraft.world.item.ItemStack, Integer> ingredientComponent, net.neoforged.neoforge.capabilities.BaseCapability<net.neoforged.neoforge.items.IItemHandler, C> capability, net.neoforged.neoforge.capabilities.BaseCapability<ISlotlessItemHandler, C> capabilitySlotless) -
Method Summary
Modifier and TypeMethodDescriptionIngredientComponent
<net.minecraft.world.item.ItemStack, Integer> IIngredientComponentStorage
<net.minecraft.world.item.ItemStack, Integer> getComponentStorage
(ICapabilityGetter<C> capabilityProvider, C context) Get the ingredient storage within the given capability provider.Optional
<net.neoforged.neoforge.items.IItemHandler> getStorage
(ICapabilityGetter<C> capabilityProvider, C context) Get the storage within the given capability provider.IIngredientComponentStorage
<net.minecraft.world.item.ItemStack, Integer> wrapComponentStorage
(net.neoforged.neoforge.items.IItemHandler storage) Wrap the given storage.IIngredientComponentStorage
<net.minecraft.world.item.ItemStack, Integer> wrapComponentStorage
(net.neoforged.neoforge.items.IItemHandler storage, ISlotlessItemHandler slotlessStorage) net.neoforged.neoforge.items.IItemHandler
wrapStorage
(IIngredientComponentStorage<net.minecraft.world.item.ItemStack, Integer> componentStorage) Wrap the given storage.
-
Constructor Details
-
IngredientComponentStorageWrapperHandlerItemStack
public IngredientComponentStorageWrapperHandlerItemStack(IngredientComponent<net.minecraft.world.item.ItemStack, Integer> ingredientComponent, net.neoforged.neoforge.capabilities.BaseCapability<net.neoforged.neoforge.items.IItemHandler, C> capability, net.neoforged.neoforge.capabilities.BaseCapability<ISlotlessItemHandler, C> capabilitySlotless)
-
-
Method Details
-
wrapComponentStorage
public IIngredientComponentStorage<net.minecraft.world.item.ItemStack,Integer> wrapComponentStorage(net.neoforged.neoforge.items.IItemHandler storage) Description copied from interface:IIngredientComponentStorageWrapperHandler
Wrap the given storage.- Specified by:
wrapComponentStorage
in interfaceIIngredientComponentStorageWrapperHandler<net.minecraft.world.item.ItemStack,
Integer, net.neoforged.neoforge.items.IItemHandler, C> - Parameters:
storage
- The external storage to wrap.- Returns:
- A component storage.
-
wrapComponentStorage
public IIngredientComponentStorage<net.minecraft.world.item.ItemStack,Integer> wrapComponentStorage(net.neoforged.neoforge.items.IItemHandler storage, ISlotlessItemHandler slotlessStorage) -
wrapStorage
public net.neoforged.neoforge.items.IItemHandler wrapStorage(IIngredientComponentStorage<net.minecraft.world.item.ItemStack, Integer> componentStorage) Description copied from interface:IIngredientComponentStorageWrapperHandler
Wrap the given storage.- Specified by:
wrapStorage
in interfaceIIngredientComponentStorageWrapperHandler<net.minecraft.world.item.ItemStack,
Integer, net.neoforged.neoforge.items.IItemHandler, C> - Parameters:
componentStorage
- The component storage to wrap.- Returns:
- A component storage.
-
getStorage
public Optional<net.neoforged.neoforge.items.IItemHandler> 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<net.minecraft.world.item.ItemStack,
Integer, net.neoforged.neoforge.items.IItemHandler, C> - Parameters:
capabilityProvider
- A capability provider.context
- The context to get the storage with.- Returns:
- A storage, or null if it does not exist.
-
getComponentStorage
public IIngredientComponentStorage<net.minecraft.world.item.ItemStack,Integer> getComponentStorage(ICapabilityGetter<C> capabilityProvider, @Nullable C context) Description copied from interface:IIngredientComponentStorageWrapperHandler
Get the ingredient storage within the given capability provider.- Specified by:
getComponentStorage
in interfaceIIngredientComponentStorageWrapperHandler<net.minecraft.world.item.ItemStack,
Integer, net.neoforged.neoforge.items.IItemHandler, C> - Parameters:
capabilityProvider
- A capability provider.context
- The context to get the storage with.- Returns:
- An ingredient storage, or null if it does not exist.
-
getComponent
- Specified by:
getComponent
in interfaceIIngredientComponentStorageWrapperHandler<net.minecraft.world.item.ItemStack,
Integer, net.neoforged.neoforge.items.IItemHandler, C> - Returns:
- The ingredient component.
-