Record Class TagPredicate<T>
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.TagPredicate<T>
-
Field Summary
-
Constructor Summary
ConstructorDescriptionTagPredicate
(TagKey<T> tag, boolean expected) Creates an instance of aTagPredicate
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> com.mojang.serialization.Codec<TagPredicate<T>>
codec
(ResourceKey<? extends Registry<T>> p_298649_) final boolean
Indicates whether some other object is "equal to" this one.boolean
expected()
Returns the value of theexpected
record component.final int
hashCode()
Returns a hash code value for this object.static <T> TagPredicate<T>
static <T> TagPredicate<T>
boolean
tag()
Returns the value of thetag
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
tag
The field for thetag
record component. -
expected
private final boolean expectedThe field for theexpected
record component.
-
-
Constructor Details
-
TagPredicate
Creates an instance of aTagPredicate
record class.- Parameters:
tag
- the value for thetag
record componentexpected
- the value for theexpected
record component
-
-
Method Details
-
codec
public static <T> com.mojang.serialization.Codec<TagPredicate<T>> codec(ResourceKey<? extends Registry<T>> p_298649_) -
is
-
isNot
-
matches
-
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
tag
Returns the value of thetag
record component.- Returns:
- the value of the
tag
record component
-
expected
public boolean expected()Returns the value of theexpected
record component.- Returns:
- the value of the
expected
record component
-