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
Modifier and TypeFieldDescriptionThe field for thegetter
record component.private final EntitySubPredicate.Type
The field for thetype
record component.private final V
The field for thevariant
record component.Fields inherited from interface net.minecraft.advancements.critereon.EntitySubPredicate
CODEC
-
Constructor Summary
ConstructorDescriptionSubPredicate
(EntitySubPredicate.Type type, Function<Entity, Optional<V>> getter, V variant) Creates an instance of aSubPredicate
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.getter()
Returns the value of thegetter
record component.final int
hashCode()
Returns a hash code value for this object.boolean
matches
(Entity p_298600_, ServerLevel p_297848_, Vec3 p_298842_) final String
toString()
Returns a string representation of this record class.type()
Returns the value of thetype
record component.variant()
Returns the value of thevariant
record component.
-
Field Details
-
type
The field for thetype
record component. -
getter
The field for thegetter
record component. -
variant
The field for thevariant
record component.
-
-
Constructor Details
-
SubPredicate
Creates an instance of aSubPredicate
record class.- Parameters:
type
- the value for thetype
record componentgetter
- the value for thegetter
record componentvariant
- the value for thevariant
record component
-
-
Method Details
-
matches
- Specified by:
matches
in interfaceEntitySubPredicate
-
type
Returns the value of thetype
record component.- Specified by:
type
in interfaceEntitySubPredicate
- Returns:
- the value of the
type
record 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 thegetter
record component.- Returns:
- the value of the
getter
record component
-
variant
Returns the value of thevariant
record component.- Returns:
- the value of the
variant
record component
-