Class IngredientChannelAdapterWrapperSlotted<T,M>

java.lang.Object
org.cyclops.integrateddynamics.core.network.IngredientChannelAdapterWrapperSlotted<T,M>
Type Parameters:
T - The instance type.
M - The matching condition parameter.
All Implemented Interfaces:
Iterable<T>, org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<T,M>, org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorageSlotted<T,M>

public class IngredientChannelAdapterWrapperSlotted<T,M> extends Object implements org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorageSlotted<T,M>
A slotted wrapper over IngredientChannelAdapter. It exposes slots by chaining storages sequentially, not using the index.
  • Constructor Summary

    Constructors
    Constructor
    Description
    IngredientChannelAdapterWrapperSlotted(IngredientChannelAdapter<T,M> channel, it.unimi.dsi.fastutil.ints.Int2IntMap cacheChannelSlots)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    extract(int slotAbsolute, long maxQuantity, net.neoforged.neoforge.transfer.transaction.TransactionContext transaction)
     
    extract(long maxQuantity, net.neoforged.neoforge.transfer.transaction.TransactionContext transaction)
     
    extract(T prototype, M matchCondition, net.neoforged.neoforge.transfer.transaction.TransactionContext transaction)
     
    org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T,M>
     
    protected static int
    getIngredientComponentStorageSize(org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<?,?> storage)
     
    long
     
    long
    getMaxQuantity(int slotAbsolute)
     
    getSlotContents(int slotAbsolute)
     
    int
     
    protected org.apache.commons.lang3.tuple.Triple<org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<T,M>,Integer,PartPos>
     
    insert(int slotAbsolute, T ingredient, net.neoforged.neoforge.transfer.transaction.TransactionContext transaction)
     
    insert(T ingredient, net.neoforged.neoforge.transfer.transaction.TransactionContext transaction)
     
     
    iterator(T prototype, M matchCondition)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage

    extract, extract, insert

    Methods inherited from interface org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorageSlotted

    extract, insert

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Constructor Details

    • IngredientChannelAdapterWrapperSlotted

      public IngredientChannelAdapterWrapperSlotted(IngredientChannelAdapter<T,M> channel, it.unimi.dsi.fastutil.ints.Int2IntMap cacheChannelSlots)
  • Method Details

    • getIngredientComponentStorageSize

      protected static int getIngredientComponentStorageSize(org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<?,?> storage)
    • getSlots

      public int getSlots()
      Specified by:
      getSlots in interface org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorageSlotted<T,M>
    • getStorageAndRelativeSlot

      protected org.apache.commons.lang3.tuple.Triple<org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<T,M>,Integer,PartPos> getStorageAndRelativeSlot(int slot)
    • getSlotContents

      public T getSlotContents(int slotAbsolute)
      Specified by:
      getSlotContents in interface org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorageSlotted<T,M>
    • getMaxQuantity

      public long getMaxQuantity(int slotAbsolute)
      Specified by:
      getMaxQuantity in interface org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorageSlotted<T,M>
    • insert

      public T insert(int slotAbsolute, @Nonnull T ingredient, net.neoforged.neoforge.transfer.transaction.TransactionContext transaction)
      Specified by:
      insert in interface org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorageSlotted<T,M>
    • extract

      public T extract(int slotAbsolute, long maxQuantity, net.neoforged.neoforge.transfer.transaction.TransactionContext transaction)
      Specified by:
      extract in interface org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorageSlotted<T,M>
    • getComponent

      public org.cyclops.commoncapabilities.api.ingredient.IngredientComponent<T,M> getComponent()
      Specified by:
      getComponent in interface org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<T,M>
    • iterator

      public Iterator<T> iterator()
      Specified by:
      iterator in interface org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<T,M>
      Specified by:
      iterator in interface Iterable<T>
    • iterator

      public Iterator<T> iterator(@Nonnull T prototype, M matchCondition)
      Specified by:
      iterator in interface org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<T,M>
    • getMaxQuantity

      public long getMaxQuantity()
      Specified by:
      getMaxQuantity in interface org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<T,M>
    • insert

      public T insert(@Nonnull T ingredient, net.neoforged.neoforge.transfer.transaction.TransactionContext transaction)
      Specified by:
      insert in interface org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<T,M>
    • extract

      public T extract(@Nonnull T prototype, M matchCondition, net.neoforged.neoforge.transfer.transaction.TransactionContext transaction)
      Specified by:
      extract in interface org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<T,M>
    • extract

      public T extract(long maxQuantity, net.neoforged.neoforge.transfer.transaction.TransactionContext transaction)
      Specified by:
      extract in interface org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage<T,M>