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 TypeMethodDescriptionlong
extract
(C context, T what, long amount, Actionable mode) findCarriedContext
(net.minecraft.world.entity.player.Player player, net.minecraft.world.inventory.AbstractContainerMenu menu) default C
findPlayerSlotContext
(net.minecraft.world.entity.player.Player player, int slot) @Nullable GenericStack
getContainedStack
(net.minecraft.world.item.ItemStack stack) @Nullable GenericStack
getExtractableContent
(C context) long
insert
(C context, T what, long amount, Actionable mode) void
playEmptySound
(net.minecraft.world.entity.player.Player player, T what) void
playFillSound
(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)
-