diff --git a/src/main/java/world/bentobox/challenges/utils/GuiUtils.java b/src/main/java/world/bentobox/challenges/utils/GuiUtils.java index da5eebe..737f735 100644 --- a/src/main/java/world/bentobox/challenges/utils/GuiUtils.java +++ b/src/main/java/world/bentobox/challenges/utils/GuiUtils.java @@ -374,13 +374,15 @@ public class GuiUtils */ public static List stringSplit(String string) { + // Remove all ending lines from string. + string = string.replaceAll("([\\r\\n])", "\\|"); string = ChatColor.translateAlternateColorCodes('&', string); // Check length of lines List result = new ArrayList<>(); - Arrays.asList(string.split("\\|")). - forEach(line -> result.addAll( - Arrays.asList(WordUtils.wrap(line, 25).split("\\n")))); + Arrays.stream(string.split("\\|")). + map(line -> Arrays.asList(WordUtils.wrap(line, 25).split("\\r\\n"))). + forEach(result::addAll); return result; }