Record Class EntityVariantPredicate.SubPredicate<V>
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.EntityVariantPredicate.SubPredicate<V>
- All Implemented Interfaces:
EntitySubPredicate
- Enclosing class:
- EntityVariantPredicate<V>
public static record EntityVariantPredicate.SubPredicate<V>(EntitySubPredicate.Type type, Function<Entity,Optional<V>> getter, V variant)
extends Record
implements EntitySubPredicate
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.advancements.critereon.EntitySubPredicate
EntitySubPredicate.Type, EntitySubPredicate.Types -
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for thegetterrecord component.private final EntitySubPredicate.TypeThe field for thetyperecord component.private final VThe field for thevariantrecord component.Fields inherited from interface net.minecraft.advancements.critereon.EntitySubPredicate
CODEC -
Constructor Summary
ConstructorsConstructorDescriptionSubPredicate(EntitySubPredicate.Type type, Function<Entity, Optional<V>> getter, V variant) Creates an instance of aSubPredicaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.getter()Returns the value of thegetterrecord component.final inthashCode()Returns a hash code value for this object.booleanmatches(Entity p_298600_, ServerLevel p_297848_, Vec3 p_298842_) final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.variant()Returns the value of thevariantrecord component.
-
Field Details
-
type
The field for thetyperecord component. -
getter
The field for thegetterrecord component. -
variant
The field for thevariantrecord component.
-
-
Constructor Details
-
SubPredicate
Creates an instance of aSubPredicaterecord class.- Parameters:
type- the value for thetyperecord componentgetter- the value for thegetterrecord componentvariant- the value for thevariantrecord component
-
-
Method Details
-
matches
- Specified by:
matchesin interfaceEntitySubPredicate
-
type
Returns the value of thetyperecord component.- Specified by:
typein interfaceEntitySubPredicate- Returns:
- the value of the
typerecord component
-
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). -
getter
Returns the value of thegetterrecord component.- Returns:
- the value of the
getterrecord component
-
variant
Returns the value of thevariantrecord component.- Returns:
- the value of the
variantrecord component
-