Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static String getSplitedText(String text) {
- String[] split = text.split(" ");
- String ret = "";
- text = "";
- int length = 1000;
- int maxLenght = 100;
- for (int i = 0; i<split.length; i++) {
- int addLength = CenterMessage.getLength(split[i]);
- if (length + addLength > maxLenght) {
- ret += "§§§7" + text;
- text = split[i];
- length = addLength+4;
- continue;
- }
- length += addLength+4;
- text += " " +split[i];
- }
- if (text.endsWith(" ")) text = text.substring(0, text.length()-1);
- if (text != "") ret += "§§§7" + text;
- return ret.replaceFirst("§§§7", "");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement