Class ExactItemFilter
java.lang.Object
alexiil.mc.lib.attributes.item.filter.ExactItemFilter
- All Implemented Interfaces:
ItemFilter,ReadableItemFilter
An
ItemFilter that only matches on a single Item.-
Nested Class Summary
Nested classes/interfaces inherited from interface alexiil.mc.lib.attributes.item.filter.ItemFilter
ItemFilter.ItemFilterAsPredicate -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ReadableItemFilteranyOf(Collection<? extends net.minecraft.item.ItemConvertible> items)static ReadableItemFilteranyOf(net.minecraft.item.ItemConvertible[] items)static ReadableItemFiltercreateFilter(net.minecraft.item.ItemConvertible entry)booleanmatches(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, waitMethods inherited from interface alexiil.mc.lib.attributes.item.filter.ItemFilter
and, asPredicate, negate, or
-
Field Details
-
item
public final net.minecraft.item.Item item
-
-
Constructor Details
-
ExactItemFilter
public ExactItemFilter(net.minecraft.item.Item item)
-
-
Method Details
-
createFilter
- Returns:
- Either
ConstantItemFilter.NOTHINGifItemConvertible.asItem()returnsItems.AIR, or anExactItemFilterif it returns any otherItem.
-
anyOf
public static ReadableItemFilter anyOf(Collection<? extends net.minecraft.item.ItemConvertible> items) -
anyOf
-
matches
public boolean matches(net.minecraft.item.ItemStack stack)Description copied from interface:ItemFilterChecks 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:
matchesin interfaceItemFilter
-