Record Class SheepPredicate
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.SheepPredicate
- All Implemented Interfaces:
EntitySubPredicate
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSheepPredicate
(Optional<Boolean> sheared, Optional<DyeColor> color) Creates an instance of aSheepPredicate
record class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec
<SheepPredicate> codec()
color()
Returns the value of thecolor
record component.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
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. -
color
The field for thecolor
record component. -
CODEC
-
-
Constructor Details
-
SheepPredicate
Creates an instance of aSheepPredicate
record class.- Parameters:
sheared
- the value for thesheared
record componentcolor
- the value for thecolor
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
-
color
Returns the value of thecolor
record component.- Returns:
- the value of the
color
record component
-