From 256581fa086bb80911e9d7ee8fdb42095a650136 Mon Sep 17 00:00:00 2001 From: sebampuero Date: Sat, 15 Mar 2025 21:22:20 +0100 Subject: [PATCH] fix: use char instead of str --- .../lol/hyper/toolstats/tools/config/ConfigTools.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/lol/hyper/toolstats/tools/config/ConfigTools.java b/src/main/java/lol/hyper/toolstats/tools/config/ConfigTools.java index a176dc1..e8e3fe5 100644 --- a/src/main/java/lol/hyper/toolstats/tools/config/ConfigTools.java +++ b/src/main/java/lol/hyper/toolstats/tools/config/ConfigTools.java @@ -136,7 +136,8 @@ public class ConfigTools { /** * Format a string with several placeholders to be ready for lore usage. - * @param configName The message to use. + * + * @param configName The message to use. * @param placeHoldersValues Map containing placeholders names as keys and values. * @return Formatted string, null if the configName doesn't exist. */ @@ -161,13 +162,13 @@ public class ConfigTools { while (matcher.find()) { String placeholder = matcher.group(1); String unit = matcher.group(2); - + result.append(lore, lastEnd, matcher.start()); - + if (placeHoldersValues.containsKey(placeholder)) { result.append(placeHoldersValues.get(placeholder)).append(unit).append(" "); } - + // Update lastEnd to end of the match lastEnd = matcher.end(); }