mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-04-13 09:41:09 +00:00
Add PlayerInputEvent
This commit is contained in:
parent
72059e3559
commit
553558256c
1 changed files with 45 additions and 0 deletions
45
src/main/java/org/bukkit/event/player/PlayerInputEvent.java
Normal file
45
src/main/java/org/bukkit/event/player/PlayerInputEvent.java
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
package org.bukkit.event.player;
|
||||||
|
|
||||||
|
import org.bukkit.Input;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
|
import org.jetbrains.annotations.ApiStatus;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This event is called when a player sends updated input to the server.
|
||||||
|
*
|
||||||
|
* @see Player#getCurrentInput()
|
||||||
|
*/
|
||||||
|
@ApiStatus.Experimental
|
||||||
|
public class PlayerInputEvent extends PlayerEvent {
|
||||||
|
|
||||||
|
private static final HandlerList handlers = new HandlerList();
|
||||||
|
private final Input input;
|
||||||
|
|
||||||
|
public PlayerInputEvent(@NotNull final Player player, @NotNull final Input input) {
|
||||||
|
super(player);
|
||||||
|
this.input = input;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the new input received from this player.
|
||||||
|
*
|
||||||
|
* @return the new input
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
public Input getInput() {
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public HandlerList getHandlers() {
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public static HandlerList getHandlerList() {
|
||||||
|
return handlers;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue