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 de8998e411
Commit 2b6b81bde9

Datei anzeigen

@ -3416,6 +3416,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;