Interface ResourcePredicate
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A condition on resource variants (ARCHITECTURE.md ยง9.3). Tags are evaluated against the snapshot
passed in, so predicates stay valid across tag reloads. Matching never implies conversion.
-
Method Summary
Modifier and TypeMethodDescriptiondefault @NotNull ResourcePredicateand(@NotNull ResourcePredicate other) static @NotNull ResourcePredicateany()default @NotNull Predicate<ResourceVariant> bind(@NotNull ResourceTags tags) static @NotNull ResourcePredicatecategory(@NotNull ResourceCategory category) static <T> @NotNull ResourcePredicatecomponent(@NotNull ResourceComponentType<T> component, @NotNull Predicate<? super T> condition) Matches variants whosecomponentis present and satisfiescondition.static @NotNull ResourcePredicateexactly(@NotNull ResourceVariant expected) static @NotNull ResourcePredicatehasComponent(@NotNull ResourceComponentType<?> component) default @NotNull ResourcePredicatenegate()static @NotNull ResourcePredicatenone()default @NotNull ResourcePredicateor(@NotNull ResourcePredicate other) static @NotNull ResourcePredicatetag(@NotNull net.kyori.adventure.key.Key tag) booleantest(@NotNull ResourceVariant variant, @NotNull ResourceTags tags) static @NotNull ResourcePredicatetype(@NotNull ResourceType type) Matches exactly this registered type (by reference, D9).static @NotNull ResourcePredicatetypes(@NotNull ResourceType... types)
-
Method Details
-
test
-
bind
- Returns:
- a plain predicate evaluated against one tag snapshot
-
and
-
or
-
negate
-
any
-
none
-
type
Matches exactly this registered type (by reference, D9). -
types
-
category
-
tag
-
exactly
-
hasComponent
@NotNull static @NotNull ResourcePredicate hasComponent(@NotNull @NotNull ResourceComponentType<?> component) -
component
@NotNull static <T> @NotNull ResourcePredicate component(@NotNull @NotNull ResourceComponentType<T> component, @NotNull @NotNull Predicate<? super T> condition) Matches variants whosecomponentis present and satisfiescondition.
-