Class AggregateItemFilter
java.lang.Object
alexiil.mc.lib.attributes.item.filter.AggregateItemFilter
- All Implemented Interfaces:
ItemFilter,ReadableItemFilter,java.lang.Iterable<ItemFilter>
public final class AggregateItemFilter extends java.lang.Object implements ReadableItemFilter, java.lang.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 Modifier and Type Field Description AggregateFilterTypetype -
Constructor Summary
Constructors Constructor Description AggregateItemFilter(AggregateFilterType type, ItemFilter... filters) -
Method Summary
Modifier and Type Method Description static ItemFilterallOf(ItemFilter... filters)static ItemFilterallOf(java.util.List<? extends ItemFilter> filters)static ItemFilterand(ItemFilter filterA, ItemFilter filterB)static ItemFilteranyOf(ItemFilter... filters)static ItemFilteranyOf(java.util.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, java.util.List<? extends ItemFilter> filters)ItemFiltergetFilter(int index)intgetFilterCount()java.util.Iterator<ItemFilter>iterator()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, or
-
Field Details
-
Constructor Details
-
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
public static ItemFilter combine(AggregateFilterType type, java.util.List<? extends ItemFilter> filters) -
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 interfacejava.lang.Iterable<ItemFilter>
-