Class AnyOfPredicate
java.lang.Object
top.offsetmonkey538.loottablemodifier.common.api.resource.predicate.op.AnyOfPredicate
- All Implemented Interfaces:
Predicate<LootModifierContext>,LootModifierPredicate
Matches when any of the provided predicates match
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<AnyOfPredicate>The codecprotected final List<LootModifierPredicate>The terms of this predicate -
Method Summary
Modifier and TypeMethodDescriptionstatic AnyOfPredicate.Builderbuilder()Creates a builder forAnyOfPredicateprotected static <T extends top.offsetmonkey538.loottablemodifier.common.api.resource.predicate.op.TermsPredicate>
com.mojang.serialization.MapCodec<T>createCodec(Function<List<LootModifierPredicate>, T> constructor) Creates a codec for the terms predicate using the provided constructor.getType()Returns the type of this action.booleantest(@NotNull LootModifierContext context) Tests this predicate against the provided context.
-
Field Details
-
CODEC
The codec -
terms
The terms of this predicate
-
-
Method Details
-
getType
Description copied from interface:LootModifierPredicateReturns the type of this action.- Returns:
- the
typeof this action.
-
builder
Creates a builder forAnyOfPredicate- Returns:
- a new
AnyOfPredicate.Builder
-
createCodec
protected static <T extends top.offsetmonkey538.loottablemodifier.common.api.resource.predicate.op.TermsPredicate> com.mojang.serialization.MapCodec<T> createCodec(Function<List<LootModifierPredicate>, T> constructor) Creates a codec for the terms predicate using the provided constructor.- Type Parameters:
T- the terms predicate- Parameters:
constructor- the constructor of the predicate.- Returns:
- a codec for the terms predicate using the provided constructor
-
test
Description copied from interface:LootModifierPredicateTests this predicate against the provided context.- Specified by:
testin interfaceLootModifierPredicate- Specified by:
testin interfacePredicate<LootModifierContext>- Parameters:
context- the context to match against- Returns:
- if this predicate matched the provided context
-