diff --git a/src/main/java/cc/moecraft/utils/StringUtils.java b/src/main/java/cc/moecraft/utils/StringUtils.java index 670d293..09bfda5 100644 --- a/src/main/java/cc/moecraft/utils/StringUtils.java +++ b/src/main/java/cc/moecraft/utils/StringUtils.java @@ -172,13 +172,19 @@ public static String replaceVariables(String original, Object ... variablesAndRe { StringBuilder builder = new StringBuilder(); + boolean first = true; for (String line : original.split("\n")) { for (int i = 0; i < variablesAndReplacements.length; i += 2) line = line.replace("%{" + String.valueOf(variablesAndReplacements[i]) + "}", String.valueOf(variablesAndReplacements[i + 1])); - builder.append("\n").append(line); + if (first) + { + builder.append(line); + first = false; + } + else builder.append("\n").append(line); } return builder.toString();