Class AggregateItemFilter
java.lang.Object
alexiil.mc.lib.attributes.item.filter.AggregateItemFilter
- All Implemented Interfaces:
ItemFilter,ReadableItemFilter,Iterable<ItemFilter>
public final class AggregateItemFilter
extends Object
implements ReadableItemFilter, Iterable<ItemFilter>
An
ItemFilter over a predefined array of ItemFilter's. You can either iterate over this object
directly or use getFilterCount() and getFilter(int) to read every filter individually.-
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 ItemFilterallOf(ItemFilter... filters)static ItemFilterallOf(List<? extends ItemFilter> filters)static ItemFilterand(ItemFilter filterA, ItemFilter filterB)static ItemFilteranyOf(ItemFilter... filters)static ItemFilteranyOf(List<? extends ItemFilter> filters)static ItemFilteranyOf(net.minecraft.item.Item... items)static ItemFilteranyOf(net.minecraft.item.ItemStack... stacks)static ItemFiltercombine(AggregateFilterType type, ItemFilter... filters)static ItemFiltercombine(AggregateFilterType type, ItemFilter filterA, ItemFilter filterB)static ItemFiltercombine(AggregateFilterType type, List<? extends ItemFilter> filters)getFilter(int index)intiterator()booleanmatches(net.minecraft.item.ItemStack stack)Checks to see if this filter matches the given stack.static ItemFilteror(ItemFilter filterA, ItemFilter filterB)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, orMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
type
-
-
Constructor Details
-
AggregateItemFilter
-
-
Method Details
-
and
- Returns:
- An
AggregateItemFilterthat contains both of the given filters. This might not return a new object if either of the filters contains the other.
-
or
- Returns:
- An
AggregateItemFilterthat contains both of the given filters. This might not return a new object if either of the filters contains the other.
-
combine
-
allOf
-
anyOf
-
anyOf
-
anyOf
-
combine
-
allOf
-
anyOf
-
combine
-
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
-
getFilterCount
public int getFilterCount() -
getFilter
-
iterator
- Specified by:
iteratorin interfaceIterable<ItemFilter>
-