Record Class DataComponentMatchers
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.DataComponentMatchers
- All Implemented Interfaces:
Predicate<DataComponentGetter>
public record DataComponentMatchers(DataComponentExactPredicate exact, Map<DataComponentPredicate.Type<?>,DataComponentPredicate> partial)
extends Record
implements Predicate<DataComponentGetter>
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DataComponentMatchers
static final com.mojang.serialization.MapCodec
<DataComponentMatchers> private final DataComponentExactPredicate
The field for theexact
record component.private final Map
<DataComponentPredicate.Type<?>, DataComponentPredicate> The field for thepartial
record component.static final StreamCodec
<RegistryFriendlyByteBuf, DataComponentMatchers> -
Constructor Summary
ConstructorsConstructorDescriptionDataComponentMatchers
(DataComponentExactPredicate exact, Map<DataComponentPredicate.Type<?>, DataComponentPredicate> partial) Creates an instance of aDataComponentMatchers
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.exact()
Returns the value of theexact
record component.final int
hashCode()
Returns a hash code value for this object.boolean
isEmpty()
partial()
Returns the value of thepartial
record component.boolean
test
(DataComponentGetter p_411093_) final String
toString()
Returns a string representation of this record class.
-
Field Details
-
exact
The field for theexact
record component. -
partial
The field for thepartial
record component. -
ANY
-
CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
DataComponentMatchers
public DataComponentMatchers(DataComponentExactPredicate exact, Map<DataComponentPredicate.Type<?>, DataComponentPredicate> partial) Creates an instance of aDataComponentMatchers
record class.- Parameters:
exact
- the value for theexact
record componentpartial
- the value for thepartial
record component
-
-
Method Details
-
test
- Specified by:
test
in interfacePredicate<DataComponentGetter>
-
isEmpty
public boolean isEmpty() -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
exact
Returns the value of theexact
record component.- Returns:
- the value of the
exact
record component
-
partial
Returns the value of thepartial
record component.- Returns:
- the value of the
partial
record component
-