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:
Ursprung
de8998e411
Commit
2b6b81bde9
@ -3416,6 +3416,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
}
|
}
|
||||||
// Paper end
|
// 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()
|
public Player.Spigot spigot()
|
||||||
{
|
{
|
||||||
return this.spigot;
|
return this.spigot;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren