Finish API
This commit is contained in:
parent
2a1ace0cf2
commit
8e8d6aeeb0
448 changed files with 274 additions and 266 deletions
41
patches/api/0443-Add-player-idle-duration-API.patch
Normal file
41
patches/api/0443-Add-player-idle-duration-API.patch
Normal file
|
@ -0,0 +1,41 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: booky10 <boooky10@gmail.com>
|
||||
Date: Sat, 14 Oct 2023 03:11:11 +0200
|
||||
Subject: [PATCH] Add player idle duration API
|
||||
|
||||
Implements API for getting and resetting a player's idle duration.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 0909c7d1dae6192e3103f4eaeb08bf3efbbd4153..962283d336e6d53941cebbc3a995d403ff989f66 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -3387,6 +3387,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…
Add table
Add a link
Reference in a new issue