Expose server build information (#10729)
* Expose server build information * squash patches * final tweaks --------- Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: masmc05 <masmc05@gmail.com>
This commit is contained in:
parent
3fc93581bb
commit
f17519338b
1360 changed files with 1817 additions and 1446 deletions
30
patches/server/0915-Add-player-idle-duration-API.patch
Normal file
30
patches/server/0915-Add-player-idle-duration-API.patch
Normal file
|
@ -0,0 +1,30 @@
|
|||
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/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 4bdbc94f7221a88ee073e73ec0a13af51f704478..9c818bb1ea5c9dc8764845d5930d60503fc06f54 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -3391,6 +3391,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
}
|
||||
// Paper end
|
||||
|
||||
+ // Paper start
|
||||
+ @Override
|
||||
+ public Duration getIdleDuration() {
|
||||
+ return Duration.ofMillis(net.minecraft.Util.getMillis() - this.getHandle().getLastActionTime());
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void resetIdleDuration() {
|
||||
+ this.getHandle().resetLastActionTime();
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
public Player.Spigot spigot()
|
||||
{
|
||||
return this.spigot;
|
Loading…
Add table
Add a link
Reference in a new issue