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 AggregateFilterType
type
-
Constructor Summary
Constructors Constructor Description AggregateItemFilter(AggregateFilterType type, ItemFilter... filters)
-
Method Summary
Modifier and Type Method Description static ItemFilter
allOf(ItemFilter... filters)
static ItemFilter
allOf(java.util.List<? extends ItemFilter> filters)
static ItemFilter
and(ItemFilter filterA, ItemFilter filterB)
static ItemFilter
anyOf(ItemFilter... filters)
static ItemFilter
anyOf(java.util.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, java.util.List<? extends ItemFilter> filters)
ItemFilter
getFilter(int index)
int
getFilterCount()
java.util.Iterator<ItemFilter>
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
-
Field Details
-
Constructor Details
-
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
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: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 interfacejava.lang.Iterable<ItemFilter>
-