Interface ContainerItemStrategy<T extends AEKey,C>

Type Parameters:
C - Any context object that can accept or offer resources, directly or indirectly. Usually the API instance such as Storage<FluidVariant> on fabric.

@Experimental public interface ContainerItemStrategy<T extends AEKey,C>
Strategy to interact with the non-item keys held by container items, for example the fluid contained in a bucket.
  • Method Details

    • getContainedStack

      @Nullable @Nullable GenericStack getContainedStack(net.minecraft.world.item.ItemStack stack)
    • findCarriedContext

      @Nullable C findCarriedContext(net.minecraft.world.entity.player.Player player, net.minecraft.world.inventory.AbstractContainerMenu menu)
    • findPlayerSlotContext

      @Nullable default C findPlayerSlotContext(net.minecraft.world.entity.player.Player player, int slot)
    • extract

      long extract(C context, T what, long amount, Actionable mode)
    • insert

      long insert(C context, T what, long amount, Actionable mode)
    • playFillSound

      void playFillSound(net.minecraft.world.entity.player.Player player, T what)
    • playEmptySound

      void playEmptySound(net.minecraft.world.entity.player.Player player, T what)
    • getExtractableContent

      @Nullable @Nullable GenericStack getExtractableContent(C context)
    • register

      static <T extends AEKey> void register(AEKeyType keyType, Class<T> keyClass, ContainerItemStrategy<T,?> strategy)