Class ItemStackHelper

java.lang.Object
net.ixdarklord.coolcatcore.api.utils.ItemStackHelper

public final class ItemStackHelper extends Object
Item stack helpers for what 1.20.1's ItemStack lacks (it has NBT tags, not data components).
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    hashItemAndTags(@Nullable net.minecraft.world.item.ItemStack stack)
    A hash of the stack's item and tag, ignoring the count: equal for stacks that ItemStack.isSameItemSameTags(net.minecraft.world.item.ItemStack, net.minecraft.world.item.ItemStack) considers the same.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • hashItemAndTags

      public static int hashItemAndTags(@Nullable @Nullable net.minecraft.world.item.ItemStack stack)
      A hash of the stack's item and tag, ignoring the count: equal for stacks that ItemStack.isSameItemSameTags(net.minecraft.world.item.ItemStack, net.minecraft.world.item.ItemStack) considers the same. The 1.20.1 counterpart of newer versions' ItemStack.hashItemAndComponents.