Record Class Input
java.lang.Object
java.lang.Record
net.minecraft.world.entity.player.Input
public record Input(boolean forward, boolean backward, boolean left, boolean right, boolean jump, boolean shift, boolean sprint)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final boolean
The field for thebackward
record component.static Input
private static final byte
private static final byte
private static final byte
private static final byte
private static final byte
private static final byte
private static final byte
private final boolean
The field for theforward
record component.private final boolean
The field for thejump
record component.private final boolean
The field for theleft
record component.private final boolean
The field for theright
record component.private final boolean
The field for theshift
record component.private final boolean
The field for thesprint
record component.static final StreamCodec
<FriendlyByteBuf, Input> -
Constructor Summary
ConstructorsConstructorDescriptionInput
(boolean forward, boolean backward, boolean left, boolean right, boolean jump, boolean shift, boolean sprint) Creates an instance of aInput
record class. -
Method Summary
Modifier and TypeMethodDescriptionboolean
backward()
Returns the value of thebackward
record component.final boolean
Indicates whether some other object is "equal to" this one.boolean
forward()
Returns the value of theforward
record component.final int
hashCode()
Returns a hash code value for this object.boolean
jump()
Returns the value of thejump
record component.boolean
left()
Returns the value of theleft
record component.boolean
right()
Returns the value of theright
record component.boolean
shift()
Returns the value of theshift
record component.boolean
sprint()
Returns the value of thesprint
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
forward
private final boolean forwardThe field for theforward
record component. -
backward
private final boolean backwardThe field for thebackward
record component. -
left
private final boolean leftThe field for theleft
record component. -
right
private final boolean rightThe field for theright
record component. -
jump
private final boolean jumpThe field for thejump
record component. -
shift
private final boolean shiftThe field for theshift
record component. -
sprint
private final boolean sprintThe field for thesprint
record component. -
FLAG_FORWARD
private static final byte FLAG_FORWARD- See Also:
-
FLAG_BACKWARD
private static final byte FLAG_BACKWARD- See Also:
-
FLAG_LEFT
private static final byte FLAG_LEFT- See Also:
-
FLAG_RIGHT
private static final byte FLAG_RIGHT- See Also:
-
FLAG_JUMP
private static final byte FLAG_JUMP- See Also:
-
FLAG_SHIFT
private static final byte FLAG_SHIFT- See Also:
-
FLAG_SPRINT
private static final byte FLAG_SPRINT- See Also:
-
STREAM_CODEC
-
EMPTY
-
-
Constructor Details
-
Input
public Input(boolean forward, boolean backward, boolean left, boolean right, boolean jump, boolean shift, boolean sprint) Creates an instance of aInput
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 componentshift
- the value for theshift
record componentsprint
- the value for thesprint
record component
-
-
Method Details
-
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 with '=='. -
forward
public boolean forward()Returns the value of theforward
record component.- Returns:
- the value of the
forward
record component
-
backward
public boolean backward()Returns the value of thebackward
record component.- Returns:
- the value of the
backward
record component
-
left
public boolean left()Returns the value of theleft
record component.- Returns:
- the value of the
left
record component
-
right
public boolean right()Returns the value of theright
record component.- Returns:
- the value of the
right
record component
-
jump
public boolean jump()Returns the value of thejump
record component.- Returns:
- the value of the
jump
record component
-
shift
public boolean shift()Returns the value of theshift
record component.- Returns:
- the value of the
shift
record component
-
sprint
public boolean sprint()Returns the value of thesprint
record component.- Returns:
- the value of the
sprint
record component
-