Interface ResolvableFluidFilter
- All Superinterfaces:
FluidFilter
,ReadableFluidFilter
- All Known Implementing Classes:
FluidTagFilter
,RawFluidTagFilter
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface ResolvableFluidFilter extends ReadableFluidFilter
A type of
ReadableFluidFilter
that may be resolved at a later time to a fixed ReadableFluidFilter
,
but which isn't constant over time. (For example item tags may be reloaded, but are stored in a static field and so
don't need to be re-created often. (And can be read)).-
Method Summary
Modifier and Type Method Description default boolean
matches(FluidKey fluid)
Checks to see if the given filter matches the given fluid key.ReadableFluidFilter
resolve()
Resolves thisReadableFluidFilter
.Methods inherited from interface alexiil.mc.lib.attributes.fluid.filter.FluidFilter
and, asPredicate, negate, or
-
Method Details
-
resolve
ReadableFluidFilter resolve()Resolves thisReadableFluidFilter
. Note that this must return one of the valid types ofReadableFluidFilter
, except this!This is intended for use-cases where you actually need to read the filter - for other cases there's usually little reason to call this, as "matches" should be faster for most reasonable implementations. (However some implementations - for example lambdas - might be faster to call multiple times if you resolve them before checking them).
-
matches
Checks to see if the given filter matches the given fluid key.This is overridden primarily for lambdas - most implementing classes are expected to override this, because it will most likely be faster.
- Specified by:
matches
in interfaceFluidFilter
-