From 78ad511a3fe6567192b52b62c0a418d2c7e58b47 Mon Sep 17 00:00:00 2001 From: dajiaohuang Date: Mon, 14 Sep 2026 03:47:31 +0800 Subject: [PATCH] fix: preserve fractional TPS values --- .../placeholderapi/expansion/server/util/TpsFormatter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/at/helpch/placeholderapi/expansion/server/util/TpsFormatter.java b/src/main/java/at/helpch/placeholderapi/expansion/server/util/TpsFormatter.java index 2b9358f..d9cccb9 100644 --- a/src/main/java/at/helpch/placeholderapi/expansion/server/util/TpsFormatter.java +++ b/src/main/java/at/helpch/placeholderapi/expansion/server/util/TpsFormatter.java @@ -25,13 +25,13 @@ public TpsFormatter(@NotNull final String lowColor, @NotNull final String medium } /** - * Round the tps and append a {@code *} before if the value is higher than 20.0 + * Round the tps to the nearest tenth and append a {@code *} before if the value is higher than 20.0 * * @param tps tps - * @return tps rounded + * @return tps rounded to the nearest tenth */ private @NotNull String round(final double tps) { - final double finalTps = Math.min(Math.round(tps), 20.0); + final double finalTps = Math.min(Math.round(tps * 10.0) / 10.0, 20.0); return (tps > 20.0 ? "*" : "") + finalTps; }