Class ItemClassFilter
java.lang.Object
alexiil.mc.lib.attributes.item.filter.ItemClassFilter
- All Implemented Interfaces:
ItemFilter
,ReadableItemFilter
public final class ItemClassFilter extends java.lang.Object implements ReadableItemFilter
A
ReadableItemFilter
that only matches items that are Class.isInstance(Object)
of a certain
Class
, and are NOT empty
.-
Nested Class Summary
Nested classes/interfaces inherited from interface alexiil.mc.lib.attributes.item.filter.ItemFilter
ItemFilter.ItemFilterAsPredicate
-
Field Summary
Fields Modifier and Type Field Description java.lang.Class<?>
matchedClass
-
Constructor Summary
Constructors Constructor Description ItemClassFilter(java.lang.Class<?> matchedClass)
-
Method Summary
Modifier and Type Method Description boolean
matches(net.minecraft.item.ItemStack stack)
Checks to see if this filter matches the given stack.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface alexiil.mc.lib.attributes.item.filter.ItemFilter
and, asPredicate, negate, or
-
Field Details
-
matchedClass
public final java.lang.Class<?> matchedClass
-
-
Constructor Details
-
ItemClassFilter
public ItemClassFilter(java.lang.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 aboutItemStack.getCount()
, except in the case where the stack isItemStack.isEmpty()
, which isn't expected to return a useful result.- Specified by:
matches
in interfaceItemFilter
-