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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ItemFilter
allOf(ItemFilter... filters)
static ItemFilter
allOf(List<? extends ItemFilter> filters)
static ItemFilter
and(ItemFilter filterA, ItemFilter filterB)
static ItemFilter
anyOf(ItemFilter... filters)
static ItemFilter
anyOf(List<? extends ItemFilter> filters)
static ItemFilter
anyOf(net.minecraft.item.Item... items)
static ItemFilter
anyOf(net.minecraft.item.ItemStack... stacks)
static ItemFilter
combine(AggregateFilterType type, ItemFilter... filters)
static ItemFilter
combine(AggregateFilterType type, ItemFilter filterA, ItemFilter filterB)
static ItemFilter
combine(AggregateFilterType type, List<? extends ItemFilter> filters)
getFilter(int index)
int
iterator()
boolean
matches(net.minecraft.item.ItemStack stack)
Checks to see if this filter matches the given stack.static ItemFilter
or(ItemFilter filterA, ItemFilter filterB)
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
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
type
-
-
Constructor Details
-
AggregateItemFilter
-
-
Method Details
-
and
- Returns:
- An
AggregateItemFilter
that contains both of the given filters. This might not return a new object if either of the filters contains the other.
-
or
- Returns:
- An
AggregateItemFilter
that 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: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
-
getFilterCount
public int getFilterCount() -
getFilter
-
iterator
- Specified by:
iterator
in interfaceIterable<ItemFilter>
-