Class ItemStackComparators


  • public final class ItemStackComparators
    extends java.lang.Object
    A utility class for getting all available Comparators for ItemStacks.
    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • TYPE

        public static final java.util.function.Supplier<java.util.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 java.util.function.Supplier<java.util.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 java.util.function.Supplier<java.util.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 java.util.function.Supplier<java.util.Comparator<ItemStack>> DEFAULT
        The default comparator for ItemStacks.
      • ITEM_DATA

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

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

        public static final java.util.function.Supplier<java.util.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 java.util.function.Supplier<java.util.Comparator<ItemStack>> ALL