ItemStackLinkedSet .java

net.minecraft.world.item.ItemStackLinkedSet (class): members: createTypeAndComponentsSet, TYPE_AND_TAG. imports: ObjectLinkedOpenCustomHashSet, Strategy.

net.minecraft.world.itemclass23 linescommon786 B

API Surface (3)

int hashCode(final @Nullable ItemStack item)
boolean equals(final @Nullable ItemStack a, final @Nullable ItemStack b)
Set<ItemStack> createTypeAndComponentsSet()

Fields & Constants (1)

TYPE_AND_TAG

Code Graph: Dependencies (1)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

ItemStackLinkedSet.java23 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.item;
2
3
import it.unimi.dsi.fastutil.Hash.Strategy;
4
import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenCustomHashSet;
5
import java.util.Set;
6
import org.jspecify.annotations.Nullable;
7
8
public class ItemStackLinkedSet {
9
	private static final Strategy<? super ItemStack> TYPE_AND_TAG = new Strategy<ItemStack>() {
10
		public int hashCode(final @Nullable ItemStack item) {
11
			return ItemStack.hashItemAndComponents(item);
12
		}
13
14
		public boolean equals(final @Nullable ItemStack a, final @Nullable ItemStack b) {
15
			return a == b || a != null && b != null && a.isEmpty() == b.isEmpty() && ItemStack.isSameItemSameComponents(a, b);
16
		}
17
	};
18
19
	public static Set<ItemStack> createTypeAndComponentsSet() {
20
		return new ObjectLinkedOpenCustomHashSet<>(TYPE_AND_TAG);
21
	}
22
}
23

Decompiled Minecraft 26.3 source of ItemStackLinkedSet (net/minecraft/world/item/ItemStackLinkedSet.java) with Mojang official mappings, stored verbatim on the site.