13
0
geforkt von Mirrors/Paper

Add player idle duration API

Implements API for getting and resetting a player's idle duration.
Dieser Commit ist enthalten in:
booky10 2023-10-14 03:11:11 +02:00
Ursprung 3c50e35f30
Commit 2fccf1c185

Datei anzeigen

@ -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();