Record Class FishingHookPredicate
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.FishingHookPredicate
- All Implemented Interfaces:
EntitySubPredicate
public record FishingHookPredicate(Optional<Boolean> inOpenWater)
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 TypeFieldDescriptionstatic final FishingHookPredicate
static final com.mojang.serialization.MapCodec<FishingHookPredicate>
The field for theinOpenWater
record component. -
Constructor Summary
ConstructorDescriptionFishingHookPredicate
(Optional<Boolean> inOpenWater) Creates an instance of aFishingHookPredicate
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of theinOpenWater
record component.static FishingHookPredicate
inOpenWater
(boolean p_39767_) boolean
matches
(Entity p_219716_, ServerLevel p_219717_, Vec3 p_219718_) final String
toString()
Returns a string representation of this record class.type()
-
Field Details
-
inOpenWater
The field for theinOpenWater
record component. -
ANY
-
CODEC
-
-
Constructor Details
-
FishingHookPredicate
Creates an instance of aFishingHookPredicate
record class.- Parameters:
inOpenWater
- the value for theinOpenWater
record component
-
-
Method Details
-
inOpenWater
-
type
- Specified by:
type
in interfaceEntitySubPredicate
-
matches
- Specified by:
matches
in interfaceEntitySubPredicate
-
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)
. -
inOpenWater
Returns the value of theinOpenWater
record component.- Returns:
- the value of the
inOpenWater
record component
-