Class ExactItemStackFilter

java.lang.Object
alexiil.mc.lib.attributes.item.filter.ExactItemStackFilter
All Implemented Interfaces:
ItemFilter, ReadableItemFilter

public final class ExactItemStackFilter extends Object implements ReadableItemFilter
An ItemFilter that only matches on a single ItemStack, using ItemStackUtil.areEqualIgnoreAmounts(ItemStack, ItemStack).
  • Field Details

    • stack

      public final net.minecraft.item.ItemStack stack
  • Constructor Details

    • ExactItemStackFilter

      public ExactItemStackFilter(net.minecraft.item.ItemStack stack)
  • Method Details

    • matches

      public boolean matches(net.minecraft.item.ItemStack other)
      Description copied from interface: ItemFilter
      Checks to see if this filter matches the given stack. Note that this must not care about ItemStack.getCount(), except in the case where the stack is ItemStack.isEmpty(), which isn't expected to return a useful result.
      Specified by:
      matches in interface ItemFilter