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 booleanThe field for thebackwardrecord component.static Inputprivate static final byteprivate static final byteprivate static final byteprivate static final byteprivate static final byteprivate static final byteprivate static final byteprivate final booleanThe field for theforwardrecord component.private final booleanThe field for thejumprecord component.private final booleanThe field for theleftrecord component.private final booleanThe field for therightrecord component.private final booleanThe field for theshiftrecord component.private final booleanThe field for thesprintrecord 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 aInputrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbackward()Returns the value of thebackwardrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanforward()Returns the value of theforwardrecord component.final inthashCode()Returns a hash code value for this object.booleanjump()Returns the value of thejumprecord component.booleanleft()Returns the value of theleftrecord component.booleanright()Returns the value of therightrecord component.booleanshift()Returns the value of theshiftrecord component.booleansprint()Returns the value of thesprintrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
forward
private final boolean forwardThe field for theforwardrecord component. -
backward
private final boolean backwardThe field for thebackwardrecord component. -
left
private final boolean leftThe field for theleftrecord component. -
right
private final boolean rightThe field for therightrecord component. -
jump
private final boolean jumpThe field for thejumprecord component. -
shift
private final boolean shiftThe field for theshiftrecord component. -
sprint
private final boolean sprintThe field for thesprintrecord 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 aInputrecord class.- Parameters:
forward- the value for theforwardrecord componentbackward- the value for thebackwardrecord componentleft- the value for theleftrecord componentright- the value for therightrecord componentjump- the value for thejumprecord componentshift- the value for theshiftrecord componentsprint- the value for thesprintrecord 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 theforwardrecord component.- Returns:
- the value of the
forwardrecord component
-
backward
public boolean backward()Returns the value of thebackwardrecord component.- Returns:
- the value of the
backwardrecord component
-
left
public boolean left()Returns the value of theleftrecord component.- Returns:
- the value of the
leftrecord component
-
right
public boolean right()Returns the value of therightrecord component.- Returns:
- the value of the
rightrecord component
-
jump
public boolean jump()Returns the value of thejumprecord component.- Returns:
- the value of the
jumprecord component
-
shift
public boolean shift()Returns the value of theshiftrecord component.- Returns:
- the value of the
shiftrecord component
-
sprint
public boolean sprint()Returns the value of thesprintrecord component.- Returns:
- the value of the
sprintrecord component
-