fix: use char instead of str

This commit is contained in:
sebampuero
2025-03-15 21:22:20 +01:00
committed by hyperdefined
parent 818f2e7a39
commit 256581fa08

View File

@@ -136,7 +136,8 @@ public class ConfigTools {
/** /**
* Format a string with several placeholders to be ready for lore usage. * 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. * @param placeHoldersValues Map containing placeholders names as keys and values.
* @return Formatted string, null if the configName doesn't exist. * @return Formatted string, null if the configName doesn't exist.
*/ */
@@ -161,13 +162,13 @@ public class ConfigTools {
while (matcher.find()) { while (matcher.find()) {
String placeholder = matcher.group(1); String placeholder = matcher.group(1);
String unit = matcher.group(2); String unit = matcher.group(2);
result.append(lore, lastEnd, matcher.start()); result.append(lore, lastEnd, matcher.start());
if (placeHoldersValues.containsKey(placeholder)) { if (placeHoldersValues.containsKey(placeholder)) {
result.append(placeHoldersValues.get(placeholder)).append(unit).append(" "); result.append(placeHoldersValues.get(placeholder)).append(unit).append(" ");
} }
// Update lastEnd to end of the match // Update lastEnd to end of the match
lastEnd = matcher.end(); lastEnd = matcher.end();
} }