Class ContainerItemStrategies

java.lang.Object
appeng.api.behaviors.ContainerItemStrategies

public class ContainerItemStrategies extends Object
Manages ContainerItemStrategy registrations for key types.
  • Constructor Details

    • ContainerItemStrategies

      public ContainerItemStrategies()
  • Method Details

    • register

      public static <T extends AEKey> void register(AEKeyType type, Class<T> keyClass, ContainerItemStrategy<T,?> strategy)
    • isTypeSupported

      public static boolean isTypeSupported(AEKeyType type)
    • isKeySupported

      public static boolean isKeySupported(@Nullable @Nullable AEKey key)
    • getContainedStack

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

      @Nullable public static @Nullable GenericStack getContainedStack(net.minecraft.world.item.ItemStack stack, AEKeyType keyType)
      Tries to get the content of the given key type contained in the given item - if any. Allows inspecting the content of buckets, fluid tanks and other containers.
    • getEmptyingAction

      @Nullable public static @Nullable EmptyingAction getEmptyingAction(net.minecraft.world.item.ItemStack stack)
    • findCarriedContextForKey

      public static ContainerItemContext findCarriedContextForKey(@Nullable @Nullable AEKey key, net.minecraft.world.entity.player.Player player, net.minecraft.world.inventory.AbstractContainerMenu menu)
    • findCarriedContext

      @Nullable public static @Nullable ContainerItemContext findCarriedContext(@Nullable @Nullable AEKeyType keyType, net.minecraft.world.entity.player.Player player, net.minecraft.world.inventory.AbstractContainerMenu menu)
      Parameters:
      keyType - Desired key type, or null if any is ok.
    • getSupportedKeyTypes

      public static Set<AEKeyType> getSupportedKeyTypes()
    • findOwnedItemContext

      @Nullable public static @Nullable ContainerItemContext findOwnedItemContext(@Nullable @Nullable AEKeyType keyType, net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack stack)
      Finds a context for an item that is in the possession of the player, but the precise location is unknown. It might be in the inventory, on the body, or just in hand.
      Parameters:
      keyType - Desired key type, or null if any is ok.