mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 14:38:52 +00:00
Use WordUtils#wrap for text wrapping
This commit is contained in:
1 parent
80865aa060
commit
1c7d45bb81
1 file changed
+2
-2
@@ -5,6 +5,7 @@ import de.themoep.minedown.Util;
|
||||
import net.william278.annotaml.RootedMap;
|
||||
import net.william278.annotaml.YamlFile;
|
||||
import org.apache.commons.text.StringEscapeUtils;
|
||||
import org.apache.commons.text.WordUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -133,8 +134,7 @@ public class Locales {
|
||||
if (string.isBlank()) {
|
||||
return this.getRawLocale("item_no_description").orElse("N/A");
|
||||
}
|
||||
return String.join("\n", string.split("(?<=\\G.{35}\\s)"))
|
||||
.replaceAll("(.{45})", "$1\n");
|
||||
return WordUtils.wrap(string, 35);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
|
||||
Reference in new issue
Block a user