From ae9a944abfe9eeed91e5306f9abfcf83d09ca853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Dufrene?= <43671109+itsme-to@users.noreply.github.com> Date: Wed, 11 Feb 2026 15:38:03 +0100 Subject: [PATCH] Add the option to not display a text when the progress is complete When the fullbar text is set to 'none', progress bar will just display full --- .../aboodyy/progressexpansion/ProgressExpansion.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/aboodyy/progressexpansion/ProgressExpansion.java b/src/main/java/net/aboodyy/progressexpansion/ProgressExpansion.java index 71c3e68..1258d07 100644 --- a/src/main/java/net/aboodyy/progressexpansion/ProgressExpansion.java +++ b/src/main/java/net/aboodyy/progressexpansion/ProgressExpansion.java @@ -30,6 +30,7 @@ import java.text.DecimalFormat; import java.util.HashMap; import java.util.Map; +import java.util.Objects; @SuppressWarnings("unused") public class ProgressExpansion extends PlaceholderExpansion implements Configurable { @@ -160,8 +161,13 @@ public String onRequest(OfflinePlayer player, String identifier) { StringBuilder bar = new StringBuilder(); amtPerSymbol = max / length; progress = (int) Math.floor(placeholder / amtPerSymbol); - if (placeholder >= max) - return full; + progress = Math.min(progress, length); + + if (placeholder >= max) { + if (!Objects.equals(full, "none")) { + return full; + } + } while (barLength < progress) { bar.append(completed); barLength++; @@ -208,4 +214,4 @@ private String replaceNumbers(String number) { return number; } -} \ No newline at end of file +}