Enum ItemStackCollections

java.lang.Object
java.lang.Enum<ItemStackCollections>
alexiil.mc.lib.attributes.item.ItemStackCollections
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ItemStackCollections>, java.lang.constant.Constable

public enum ItemStackCollections
extends java.lang.Enum<ItemStackCollections>
Utility methods for creating Map's and Set's based on ItemStack's.

Every set or map factory method will produce a set of map using STRATEGY_IGNORE_AMOUNT or COMPARATOR_IGNORE_AMOUNT, rather than their exact versions.

  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    java.lang.Enum.EnumDesc<E extends java.lang.Enum<E>>
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.util.Comparator<net.minecraft.item.ItemStack> COMPARATOR_ID_EXACT
    A Comparator that compares ItemStack's by their Registry Identifier, then ItemStack.getTag(), then amounts.
    static java.util.Comparator<net.minecraft.item.ItemStack> COMPARATOR_IGNORE_AMOUNT
    A Comparator that compares ItemStack's by their Registry Identifier, then ItemStack.getTag().
    static it.unimi.dsi.fastutil.Hash.Strategy<net.minecraft.item.ItemStack> STRATEGY_EXACT
    A hash Hash.Strategy to use for Map's and Set's of ItemStack's where the ItemStack.getCount() is important.
    static it.unimi.dsi.fastutil.Hash.Strategy<net.minecraft.item.ItemStack> STRATEGY_IGNORE_AMOUNT
    A hash Hash.Strategy to use for Map's and Set's of ItemStack's where the ItemStack.getCount() is ignored.
  • Method Summary

    Modifier and Type Method Description
    static <V> it.unimi.dsi.fastutil.objects.Object2ObjectAVLTreeMap<net.minecraft.item.ItemStack,​V> avlTreeMap()  
    static <V> it.unimi.dsi.fastutil.objects.Object2ObjectOpenCustomHashMap<net.minecraft.item.ItemStack,​V> hashMap()  
    static it.unimi.dsi.fastutil.objects.Object2IntAVLTreeMap<net.minecraft.item.ItemStack> intAvlTreeMap()  
    static it.unimi.dsi.fastutil.objects.Object2IntOpenCustomHashMap<net.minecraft.item.ItemStack> intHashMap()  
    static it.unimi.dsi.fastutil.objects.Object2IntLinkedOpenCustomHashMap<net.minecraft.item.ItemStack> intLinkedHashMap()  
    static it.unimi.dsi.fastutil.objects.Object2IntMap<net.minecraft.item.ItemStack> intMap()
    Creates a Map that can map ItemStack's to ints.
    static it.unimi.dsi.fastutil.objects.Object2IntRBTreeMap<net.minecraft.item.ItemStack> intRbTreeMap()  
    static it.unimi.dsi.fastutil.objects.Object2IntSortedMap<net.minecraft.item.ItemStack> intSortedMap()
    Creates a SortedMap that can map ItemStack's to ints.
    static <V> it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenCustomHashMap<net.minecraft.item.ItemStack,​V> linkedHashMap()  
    static <V> java.util.Map<net.minecraft.item.ItemStack,​V> map()
    Creates a Map that can map ItemStack's to objects.
    static it.unimi.dsi.fastutil.objects.ObjectOpenCustomHashSet<net.minecraft.item.ItemStack> openHashSet()  
    static it.unimi.dsi.fastutil.objects.ObjectLinkedOpenCustomHashSet<net.minecraft.item.ItemStack> openLinkedHashSet()  
    static <V> it.unimi.dsi.fastutil.objects.Object2ObjectRBTreeMap<net.minecraft.item.ItemStack,​V> rbTreeMap()  
    static java.util.Set<net.minecraft.item.ItemStack> set()
    Creates a set that can store ItemStack's.
    static it.unimi.dsi.fastutil.objects.ObjectAVLTreeSet<net.minecraft.item.ItemStack> sortedAvlTreeSet()  
    static <V> java.util.SortedMap<net.minecraft.item.ItemStack,​V> sortedMap()
    Creates a SortedMap that can map ItemStack's to objects.
    static it.unimi.dsi.fastutil.objects.ObjectRBTreeSet<net.minecraft.item.ItemStack> sortedRbTreeSet()  
    static it.unimi.dsi.fastutil.objects.ObjectSortedSet<net.minecraft.item.ItemStack> sortedSet()
    Creates a sorted set that can store ItemStack's.
    static ItemStackCollections valueOf​(java.lang.String name)
    Returns the enum constant of this type with the specified name.
    static ItemStackCollections[] values()
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Enum

    clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • STRATEGY_EXACT

      public static final it.unimi.dsi.fastutil.Hash.Strategy<net.minecraft.item.ItemStack> STRATEGY_EXACT
      A hash Hash.Strategy to use for Map's and Set's of ItemStack's where the ItemStack.getCount() is important.
    • STRATEGY_IGNORE_AMOUNT

      public static final it.unimi.dsi.fastutil.Hash.Strategy<net.minecraft.item.ItemStack> STRATEGY_IGNORE_AMOUNT
      A hash Hash.Strategy to use for Map's and Set's of ItemStack's where the ItemStack.getCount() is ignored.
    • COMPARATOR_ID_EXACT

      public static final java.util.Comparator<net.minecraft.item.ItemStack> COMPARATOR_ID_EXACT
      A Comparator that compares ItemStack's by their Registry Identifier, then ItemStack.getTag(), then amounts.
    • COMPARATOR_IGNORE_AMOUNT

      public static final java.util.Comparator<net.minecraft.item.ItemStack> COMPARATOR_IGNORE_AMOUNT
      A Comparator that compares ItemStack's by their Registry Identifier, then ItemStack.getTag().
  • Method Details

    • values

      public static ItemStackCollections[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static ItemStackCollections valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
      java.lang.NullPointerException - if the argument is null
    • set

      public static java.util.Set<net.minecraft.item.ItemStack> set()
      Creates a set that can store ItemStack's.

      The current implementation delegates to openHashSet().

    • sortedSet

      public static it.unimi.dsi.fastutil.objects.ObjectSortedSet<net.minecraft.item.ItemStack> sortedSet()
      Creates a sorted set that can store ItemStack's.

      The current implementation delegates to sortedAvlTreeSet().

    • openHashSet

      public static it.unimi.dsi.fastutil.objects.ObjectOpenCustomHashSet<net.minecraft.item.ItemStack> openHashSet()
    • openLinkedHashSet

      public static it.unimi.dsi.fastutil.objects.ObjectLinkedOpenCustomHashSet<net.minecraft.item.ItemStack> openLinkedHashSet()
    • sortedRbTreeSet

      public static it.unimi.dsi.fastutil.objects.ObjectRBTreeSet<net.minecraft.item.ItemStack> sortedRbTreeSet()
    • sortedAvlTreeSet

      public static it.unimi.dsi.fastutil.objects.ObjectAVLTreeSet<net.minecraft.item.ItemStack> sortedAvlTreeSet()
    • map

      public static <V> java.util.Map<net.minecraft.item.ItemStack,​V> map()
      Creates a Map that can map ItemStack's to objects.

      The current implementation delegates to hashMap().

    • sortedMap

      public static <V> java.util.SortedMap<net.minecraft.item.ItemStack,​V> sortedMap()
      Creates a SortedMap that can map ItemStack's to objects.

      The current implementation delegates to avlTreeMap().

    • hashMap

      public static <V> it.unimi.dsi.fastutil.objects.Object2ObjectOpenCustomHashMap<net.minecraft.item.ItemStack,​V> hashMap()
    • linkedHashMap

      public static <V> it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenCustomHashMap<net.minecraft.item.ItemStack,​V> linkedHashMap()
    • rbTreeMap

      public static <V> it.unimi.dsi.fastutil.objects.Object2ObjectRBTreeMap<net.minecraft.item.ItemStack,​V> rbTreeMap()
    • avlTreeMap

      public static <V> it.unimi.dsi.fastutil.objects.Object2ObjectAVLTreeMap<net.minecraft.item.ItemStack,​V> avlTreeMap()
    • intMap

      public static it.unimi.dsi.fastutil.objects.Object2IntMap<net.minecraft.item.ItemStack> intMap()
      Creates a Map that can map ItemStack's to ints.

      The current implementation delegates to intHashMap().

    • intSortedMap

      public static it.unimi.dsi.fastutil.objects.Object2IntSortedMap<net.minecraft.item.ItemStack> intSortedMap()
      Creates a SortedMap that can map ItemStack's to ints.

      The current implementation delegates to intAvlTreeMap().

    • intHashMap

      public static it.unimi.dsi.fastutil.objects.Object2IntOpenCustomHashMap<net.minecraft.item.ItemStack> intHashMap()
    • intLinkedHashMap

      public static it.unimi.dsi.fastutil.objects.Object2IntLinkedOpenCustomHashMap<net.minecraft.item.ItemStack> intLinkedHashMap()
    • intRbTreeMap

      public static it.unimi.dsi.fastutil.objects.Object2IntRBTreeMap<net.minecraft.item.ItemStack> intRbTreeMap()
    • intAvlTreeMap

      public static it.unimi.dsi.fastutil.objects.Object2IntAVLTreeMap<net.minecraft.item.ItemStack> intAvlTreeMap()