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 thesheared
record component. -
Constructor Summary
ConstructorsConstructorDescriptionSheepPredicate
(Optional<Boolean> sheared) Creates an instance of aSheepPredicate
record class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec
<SheepPredicate> codec()
final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.static SheepPredicate
hasWool()
boolean
matches
(Entity p_368517_, ServerLevel p_368673_, Vec3 p_368505_) sheared()
Returns the value of thesheared
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
sheared
The field for thesheared
record component. -
CODEC
-
-
Constructor Details
-
SheepPredicate
Creates an instance of aSheepPredicate
record class.- Parameters:
sheared
- the value for thesheared
record component
-
-
Method Details
-
codec
- Specified by:
codec
in interfaceEntitySubPredicate
-
matches
- Specified by:
matches
in 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 thesheared
record component.- Returns:
- the value of the
sheared
record component
-