Record Class InputPredicate
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.InputPredicate
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for thebackward
record component.static final com.mojang.serialization.Codec
<InputPredicate> The field for theforward
record component.The field for thejump
record component.The field for theleft
record component.The field for theright
record component.The field for thesneak
record component.The field for thesprint
record component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbackward()
Returns the value of thebackward
record component.final boolean
Indicates whether some other object is "equal to" this one.forward()
Returns the value of theforward
record component.final int
hashCode()
Returns a hash code value for this object.jump()
Returns the value of thejump
record component.left()
Returns the value of theleft
record component.private boolean
boolean
right()
Returns the value of theright
record component.sneak()
Returns the value of thesneak
record component.sprint()
Returns the value of thesprint
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
forward
The field for theforward
record component. -
backward
The field for thebackward
record component. -
left
The field for theleft
record component. -
right
The field for theright
record component. -
jump
The field for thejump
record component. -
sneak
The field for thesneak
record component. -
sprint
The field for thesprint
record component. -
CODEC
-
-
Constructor Details
-
InputPredicate
public InputPredicate(Optional<Boolean> forward, Optional<Boolean> backward, Optional<Boolean> left, Optional<Boolean> right, Optional<Boolean> jump, Optional<Boolean> sneak, Optional<Boolean> sprint) Creates an instance of aInputPredicate
record class.- Parameters:
forward
- the value for theforward
record componentbackward
- the value for thebackward
record componentleft
- the value for theleft
record componentright
- the value for theright
record componentjump
- the value for thejump
record componentsneak
- the value for thesneak
record componentsprint
- the value for thesprint
record component
-
-
Method Details
-
matches
-
matches
-
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)
. -
forward
Returns the value of theforward
record component.- Returns:
- the value of the
forward
record component
-
backward
Returns the value of thebackward
record component.- Returns:
- the value of the
backward
record component
-
left
Returns the value of theleft
record component.- Returns:
- the value of the
left
record component
-
right
Returns the value of theright
record component.- Returns:
- the value of the
right
record component
-
jump
Returns the value of thejump
record component.- Returns:
- the value of the
jump
record component
-
sneak
Returns the value of thesneak
record component.- Returns:
- the value of the
sneak
record component
-
sprint
Returns the value of thesprint
record component.- Returns:
- the value of the
sprint
record component
-