First batch of server patches
This commit is contained in:
parent
e080b20c45
commit
d280061a1a
1071 changed files with 730 additions and 652 deletions
|
@ -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 a1b870fb3d1fd5d209474c47bf523d0d5d58ce39..1d79bacbfb24442573245550263141ad56332971 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -3419,6 +3419,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