Record Class SheepPredicate
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.SheepPredicate
- All Implemented Interfaces:
EntitySubPredicate
public record SheepPredicate(Optional<Boolean> sheared)
extends Record
implements EntitySubPredicate
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<SheepPredicate> The field for theshearedrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionSheepPredicate(Optional<Boolean> sheared) Creates an instance of aSheepPredicaterecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<SheepPredicate> codec()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static SheepPredicatehasWool()booleanmatches(Entity pEntity, ServerLevel pLevel, Vec3 pPosition) sheared()Returns the value of theshearedrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
sheared
The field for theshearedrecord component. -
CODEC
-
-
Constructor Details
-
SheepPredicate
Creates an instance of aSheepPredicaterecord class.- Parameters:
sheared- the value for theshearedrecord component
-
-
Method Details
-
codec
- Specified by:
codecin interfaceEntitySubPredicate
-
matches
- Specified by:
matchesin interfaceEntitySubPredicate
-
hasWool
-
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). -
sheared
Returns the value of theshearedrecord component.- Returns:
- the value of the
shearedrecord component
-