Skip to content

Commit

Permalink
[Commands] Make placeholder refresh interval color in cpu output diff…
Browse files Browse the repository at this point in the history
…erent if it was overridden in config
  • Loading branch information
NEZNAMY committed Feb 27, 2025
1 parent 9f038fa commit 7501c4f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ private void printPlaceholders(@Nullable TabPlayer sender, @NotNull Map<String,
int printCounter = 0;
for (Entry<String, Float> entry : map.entrySet()) {
if (printCounter++ == 5) break;
String refresh = "";
Placeholder p = TAB.getInstance().getPlaceholderManager().getPlaceholder(entry.getKey());
if (p.getRefresh() != -1) refresh = " &8(" + p.getRefresh() + ")&7";
Integer configuredRefresh = TAB.getInstance().getPlaceholderManager().getConfiguration().getRefreshIntervals().get(entry.getKey());
String refresh = String.format(" %s (%d)&7", configuredRefresh == null ? "&8" : "&3", p.getRefresh());
String colorized = entry.getKey().startsWith("%sync:") ? "&c" + decimal3.format(entry.getValue()) : colorize(decimal3.format(entry.getValue()), 1, 0.3f);
sendMessage(sender, String.format("&8&l%s &7%s - %s%%", LINE_CHAR, entry.getKey() + refresh, colorized));
}
Expand Down

0 comments on commit 7501c4f

Please sign in to comment.