Fix for %server_uptime%

Currently it would just display the time the server has booted but not the 'uptime' which this small change will fix.
This commit is contained in:
MrGraycat authored and GitHub committed 2020-08-04 06:43:51 +02:00
1 parent bb1011dc15
commit bf608623a2
1 file changed
+1 -1
@@ -123,7 +123,7 @@ public class ServerExpansion extends PlaceholderExpansion implements Cacheable,
case "unique_joins":
return String.valueOf(Bukkit.getOfflinePlayers().length);
case "uptime":
long seconds = TimeUnit.MILLISECONDS.toSeconds(ManagementFactory.getRuntimeMXBean().getStartTime());
long seconds = TimeUnit.MILLISECONDS.toSeconds(ManagementFactory.getRuntimeMXBean().getUptime());
return TimeUtil.getTime((int)seconds);
case "has_whitelist":
return Bukkit.getServer().hasWhitelist() ? PlaceholderAPIPlugin.booleanTrue() : PlaceholderAPIPlugin.booleanFalse();