mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-26 19:07:40 +01:00
Add player idle duration API
Implements API for getting and resetting a player's idle duration.
This commit is contained in:
parent
3c50e35f30
commit
2fccf1c185
@ -3782,6 +3782,29 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
void increaseWardenWarningLevel();
|
||||
// Paper end
|
||||
|
||||
// Paper start
|
||||
/**
|
||||
* The idle duration is reset when the player
|
||||
* sends specific action packets.
|
||||
* <p>
|
||||
* After the idle duration exceeds {@link org.bukkit.Bukkit#getIdleTimeout()}, the
|
||||
* player will be kicked for {@link org.bukkit.event.player.PlayerKickEvent.Cause#IDLING}.
|
||||
*
|
||||
* @return the current idle duration of this player
|
||||
*/
|
||||
@NotNull Duration getIdleDuration();
|
||||
|
||||
/**
|
||||
* Resets this player's idle duration.
|
||||
* <p>
|
||||
* After the idle duration exceeds {@link org.bukkit.Bukkit#getIdleTimeout()}, the
|
||||
* player will be kicked for {@link org.bukkit.event.player.PlayerKickEvent.Cause#IDLING}.
|
||||
*
|
||||
* @see #getIdleDuration()
|
||||
*/
|
||||
void resetIdleDuration();
|
||||
// Paper end
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
Spigot spigot();
|
||||
|
Loading…
Reference in New Issue
Block a user