Record Class PlayerInputEvent
java.lang.Object
java.lang.Record
fr.fidorial.event.player.PlayerInputEvent
- All Implemented Interfaces:
Event, PlayerEvent
public record PlayerInputEvent(Player player, PlayerInput previous, PlayerInput input)
extends Record
implements PlayerEvent
Fired when a player presses or releases a movement key.
Listeners run on the network thread of the player, keep them short.
- Since:
- 0.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerInputEvent(Player player, PlayerInput previous, PlayerInput input) Creates an event. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.input()Returns the keys held now.player()Returns the value of theplayerrecord component.previous()Returns the keys held before this change.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PlayerInputEvent
Creates an event.- Parameters:
player- the playerprevious- the keys held beforeinput- the keys held now- Since:
- 0.1.0
-
-
Method Details
-
previous
Returns the keys held before this change.- Returns:
- the keys held before this change
- Since:
- 0.1.0
-
input
-
toString
-
hashCode
-
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). -
player
Returns the value of theplayerrecord component.- Specified by:
playerin interfacePlayerEvent- Returns:
- the value of the
playerrecord component
-