Package appeng.api.behaviors
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 asStorage<FluidVariant> on fabric.
Strategy to interact with the non-item keys held by container items, for example the fluid contained in a bucket.
-
Method Summary
Modifier and TypeMethodDescriptionlongextract(C context, T what, long amount, Actionable mode) findCarriedContext(net.minecraft.world.entity.player.Player player, net.minecraft.world.inventory.AbstractContainerMenu menu) default CfindPlayerSlotContext(net.minecraft.world.entity.player.Player player, int slot) @Nullable GenericStackgetContainedStack(net.minecraft.world.item.ItemStack stack) @Nullable GenericStackgetExtractableContent(C context) longinsert(C context, T what, long amount, Actionable mode) voidplayEmptySound(net.minecraft.world.entity.player.Player player, T what) voidplayFillSound(net.minecraft.world.entity.player.Player player, T what) static <T extends AEKey>
voidregister(AEKeyType keyType, Class<T> keyClass, ContainerItemStrategy<T, ?> strategy)
-
Method Details
-
getContainedStack
-
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
-
insert
-
playFillSound
-
playEmptySound
-
getExtractableContent
-
register
static <T extends AEKey> void register(AEKeyType keyType, Class<T> keyClass, ContainerItemStrategy<T, ?> strategy)
-