Package alexiil.mc.lib.attributes.item
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 or map using STRATEGY_IGNORE_AMOUNT
or
COMPARATOR_IGNORE_AMOUNT
, rather than their exact versions.
-
Nested Class Summary
-
Field Summary
Fields Modifier and Type Field Description static java.util.Comparator<net.minecraft.item.ItemStack>
COMPARATOR_ID_EXACT
AComparator
that comparesItemStack
's by their RegistryIdentifier
, thenItemStack.getTag()
, then amounts.static java.util.Comparator<net.minecraft.item.ItemStack>
COMPARATOR_IGNORE_AMOUNT
AComparator
that comparesItemStack
's by their RegistryIdentifier
, thenItemStack.getTag()
.static it.unimi.dsi.fastutil.Hash.Strategy<net.minecraft.item.ItemStack>
STRATEGY_EXACT
A hashHash.Strategy
to use forMap's
andSet's
ofItemStack
's where theItemStack.getCount()
is important.static it.unimi.dsi.fastutil.Hash.Strategy<net.minecraft.item.ItemStack>
STRATEGY_IGNORE_AMOUNT
A hashHash.Strategy
to use forMap's
andSet's
ofItemStack
's where theItemStack.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 aMap
that can mapItemStack
'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 aSortedMap
that can mapItemStack
'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 aMap
that can mapItemStack
'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 storeItemStack
'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 aSortedMap
that can mapItemStack
'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 storeItemStack
'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.
-
Field Details
-
STRATEGY_EXACT
public static final it.unimi.dsi.fastutil.Hash.Strategy<net.minecraft.item.ItemStack> STRATEGY_EXACTA hashHash.Strategy
to use forMap's
andSet's
ofItemStack
's where theItemStack.getCount()
is important. -
STRATEGY_IGNORE_AMOUNT
public static final it.unimi.dsi.fastutil.Hash.Strategy<net.minecraft.item.ItemStack> STRATEGY_IGNORE_AMOUNTA hashHash.Strategy
to use forMap's
andSet's
ofItemStack
's where theItemStack.getCount()
is ignored. -
COMPARATOR_ID_EXACT
public static final java.util.Comparator<net.minecraft.item.ItemStack> COMPARATOR_ID_EXACTAComparator
that comparesItemStack
's by their RegistryIdentifier
, thenItemStack.getTag()
, then amounts. -
COMPARATOR_IGNORE_AMOUNT
public static final java.util.Comparator<net.minecraft.item.ItemStack> COMPARATOR_IGNORE_AMOUNTAComparator
that comparesItemStack
's by their RegistryIdentifier
, thenItemStack.getTag()
.
-
-
Method Details
-
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
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 namejava.lang.NullPointerException
- if the argument is null
-
set
public static java.util.Set<net.minecraft.item.ItemStack> set()Creates a set that can storeItemStack
'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 storeItemStack
'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 aMap
that can mapItemStack
's to objects.The current implementation delegates to
hashMap()
. -
sortedMap
public static <V> java.util.SortedMap<net.minecraft.item.ItemStack,V> sortedMap()Creates aSortedMap
that can mapItemStack
'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 aMap
that can mapItemStack
's to ints.The current implementation delegates to
intHashMap()
. -
intSortedMap
public static it.unimi.dsi.fastutil.objects.Object2IntSortedMap<net.minecraft.item.ItemStack> intSortedMap()Creates aSortedMap
that can mapItemStack
'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()
-