Interface IIngredientChannelInsertPreConsumer<T>


public interface IIngredientChannelInsertPreConsumer<T>
Allows (partially) consuming an ingredient before it is inserted into the network.
  • Method Summary

    Modifier and Type
    Method
    Description
    insert(int channel, T ingredient, net.neoforged.neoforge.transfer.transaction.TransactionContext transaction)
    Called before an ingredient is inserted into the network.
  • Method Details

    • insert

      T insert(int channel, @Nonnull T ingredient, net.neoforged.neoforge.transfer.transaction.TransactionContext transaction)
      Called before an ingredient is inserted into the network. If nothing needs to be consumed, the same instance can be returned.
      Parameters:
      channel - The network channel.
      ingredient - The ingredient instance.
      transaction - The current transaction.
      Returns:
      The remaining ingredient instance.