Class ItemStackComparators

java.lang.Object
org.spongepowered.api.item.inventory.ItemStackComparators

public final class ItemStackComparators extends Object
A utility class for getting all available Comparators for ItemStacks.
  • Field Details

    • TYPE

      public static final Supplier<Comparator<ItemStack>> TYPE
      Compares ItemStacks based on ItemType. This comparator will not return the same results as ItemStack.equals(ItemStack) for ItemStacks with extra attached data, different damage values, or different sizes.
    • SIZE

      public static final Supplier<Comparator<ItemStack>> SIZE
      Compares ItemStacks based on ItemStack size. This comparator will not return the same results as ItemStack.equals(ItemStack) for ItemStacks with extra attached data, different types, or different damage values.
    • TYPE_SIZE

      public static final Supplier<Comparator<ItemStack>> TYPE_SIZE
      Compares ItemStacks based on ItemType and ItemStack size. This comparator will not return the same results as ItemStack.equals(ItemStack) for ItemStacks with extra attached data or different damage values.
    • DEFAULT

      public static final Supplier<Comparator<ItemStack>> DEFAULT
      The default comparator for ItemStacks.
    • ITEM_DATA

      public static final Supplier<Comparator<ItemStack>> ITEM_DATA
      Compares ItemStacks based on their Values.
    • ITEM_DATA_IGNORE_DURABILITY

      public static final Supplier<Comparator<ItemStack>> ITEM_DATA_IGNORE_DURABILITY
      Compares ItemStacks based on their Values ignoring Keys.ITEM_DURABILITY.
    • IGNORE_SIZE

      public static final Supplier<Comparator<ItemStack>> IGNORE_SIZE
      Compares ItemStacks only ignoring their stack-size.

      This means for stackable items that they can stack together

    • ALL

      public static final Supplier<Comparator<ItemStack>> ALL