Class AggregateFluidFilter
java.lang.Object
alexiil.mc.lib.attributes.fluid.filter.AggregateFluidFilter
- All Implemented Interfaces:
FluidFilter
,ReadableFluidFilter
,java.lang.Iterable<FluidFilter>
public class AggregateFluidFilter extends java.lang.Object implements ReadableFluidFilter, java.lang.Iterable<FluidFilter>
An
FluidFilter
over a predefined array of FluidFilter
's. You can either iterate over this object
directly or use getFilterCount()
and getFilter(int)
to read every filter individually.-
Field Summary
Fields Modifier and Type Field Description AggregateFilterType
type
-
Constructor Summary
Constructors Constructor Description AggregateFluidFilter(AggregateFilterType type, FluidFilter... filters)
-
Method Summary
Modifier and Type Method Description static FluidFilter
allOf(FluidFilter... filters)
static FluidFilter
allOf(java.util.List<? extends FluidFilter> filters)
static FluidFilter
and(FluidFilter filterA, FluidFilter filterB)
static FluidFilter
anyOf(FluidFilter... filters)
static FluidFilter
anyOf(java.util.List<? extends FluidFilter> filters)
static FluidFilter
combine(AggregateFilterType type, FluidFilter... filters)
static FluidFilter
combine(AggregateFilterType type, FluidFilter filterA, FluidFilter filterB)
static FluidFilter
combine(AggregateFilterType type, java.util.List<? extends FluidFilter> filters)
FluidFilter
getFilter(int index)
int
getFilterCount()
java.util.Iterator<FluidFilter>
iterator()
boolean
matches(FluidKey fluid)
Checks to see if the given filter matches the given fluid key.static FluidFilter
or(FluidFilter filterA, FluidFilter 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.fluid.filter.FluidFilter
and, asPredicate, negate, or
-
Field Details
-
Constructor Details
-
Method Details
-
and
- Returns:
- An
AggregateFluidFilter
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
AggregateFluidFilter
that contains both of the given filters. This might not return a new object if either of the filters contains the other.
-
combine
public static FluidFilter combine(AggregateFilterType type, FluidFilter filterA, FluidFilter filterB) -
allOf
-
anyOf
-
combine
-
allOf
-
anyOf
-
combine
public static FluidFilter combine(AggregateFilterType type, java.util.List<? extends FluidFilter> filters) -
matches
Description copied from interface:FluidFilter
Checks to see if the given filter matches the given fluid key.- Specified by:
matches
in interfaceFluidFilter
-
getFilterCount
public int getFilterCount() -
getFilter
-
iterator
- Specified by:
iterator
in interfacejava.lang.Iterable<FluidFilter>
-