mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-17 21:33:49 -07:00
Add player idle duration API
Implements API for getting and resetting a player's idle duration.
This commit is contained in:
@@ -3782,6 +3782,29 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|||||||
void increaseWardenWarningLevel();
|
void increaseWardenWarningLevel();
|
||||||
// Paper end
|
// 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
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
Spigot spigot();
|
Spigot spigot();
|
||||||
|
Reference in New Issue
Block a user