Class ItemClassFilter

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

public final class ItemClassFilter extends Object implements ReadableItemFilter
A ReadableItemFilter that only matches items that are Class.isInstance(Object) of a certain Class, and are NOT empty .
  • Field Details

    • matchedClass

      public final Class<?> matchedClass
  • Constructor Details

    • ItemClassFilter

      public ItemClassFilter(Class<?> matchedClass)
  • Method Details

    • matches

      public boolean matches(net.minecraft.item.ItemStack stack)
      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