Advertisement
Guest User

Untitled

a guest
Jan 21st, 2018
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.87 KB | None | 0 0
  1.     private String styleItalicText(String message) {
  2.         String[] args = message.split(" ");
  3.         StringBuilder builder = new StringBuilder();
  4.         ARGS_LOOP:
  5.         for (int i = 0; i < args.length; i++) {
  6.             if (!args[i].startsWith("/")) {
  7.                 builder.append(args[i] + " ");
  8.                 continue;
  9.             }
  10.             if (args[i + 1] == null) {
  11.                 builder.append(ChatColor.ITALIC + args[i]);
  12.                 break;
  13.             }
  14.             ITALIC_LOOP:
  15.             for (int j = 1; i + j < args.length; j++) {
  16.                 if (!args[i + j].endsWith("/")) {
  17.                     builder.append(args[i + j] + " ");
  18.                     continue;
  19.                 }
  20.                 builder.append(args[i + j].substring(0, args[i+j].length()-1));
  21.             }
  22.         }
  23.         return builder.toString().trim();
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement