Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private String styleItalicText(String message) {
- String[] args = message.split(" ");
- StringBuilder builder = new StringBuilder();
- ARGS_LOOP:
- for (int i = 0; i < args.length; i++) {
- if (!args[i].startsWith("/")) {
- builder.append(args[i] + " ");
- continue;
- }
- if (args[i + 1] == null) {
- builder.append(ChatColor.ITALIC + args[i]);
- break;
- }
- ITALIC_LOOP:
- for (int j = 1; i + j < args.length; j++) {
- if (!args[i + j].endsWith("/")) {
- builder.append(args[i + j] + " ");
- continue;
- }
- builder.append(args[i + j].substring(0, args[i+j].length()-1));
- }
- }
- return builder.toString().trim();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement