Class ItemStackComparators


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

      • 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.
      • 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