Advertisement
a333c

Untitled

Oct 31st, 2017
394
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.72 KB | None | 0 0
  1.             String tellMes = args[0];
  2.             String newTellMes = "";
  3.             boolean begins = false;
  4.             if (tellMes.contains("&")){ //装飾コードが含まれていたなら書き換え
  5.                 for(int i=0;i>=args.length;i+=1) {
  6.                     String token = mid(args[0],i,1);
  7.                     if ("&".equals(token)) {
  8.                         if ( "\\".equals(mid(args[0],i-1,1))) {
  9.                             newTellMes += "&";
  10.                             continue;
  11.                         } else {
  12.                             begins = true;
  13.                             continue;
  14.                         }
  15.                     }
  16.                    
  17.                     if (begins) {
  18.                         switch (token) {
  19.                             case "0": newTellMes += ChatColor.BLACK+"";break;
  20.                             case "1": newTellMes += ChatColor.DARK_BLUE+"";break;
  21.                             case "2": newTellMes += ChatColor.DARK_GREEN+"";break;
  22.                             case "3": newTellMes += ChatColor.DARK_AQUA+"";break;
  23.                             case "4": newTellMes += ChatColor.DARK_RED+"";break;
  24.                             case "5": newTellMes += ChatColor.DARK_PURPLE+"";break;
  25.                             case "6": newTellMes += ChatColor.GOLD+"";break;
  26.                             case "7": newTellMes += ChatColor.GRAY+"";break;
  27.                             case "8": newTellMes += ChatColor.DARK_GRAY+"";break;
  28.                             case "9": newTellMes += ChatColor.BLUE+"";break;
  29.                             case "a": newTellMes += ChatColor.GREEN+"";break;
  30.                             case "b": newTellMes += ChatColor.AQUA+"";break;
  31.                             case "c": newTellMes += ChatColor.RED+"";break;
  32.                             case "d": newTellMes += ChatColor.LIGHT_PURPLE+"";break;
  33.                             case "e": newTellMes += ChatColor.YELLOW+"";break;
  34.                             case "f": newTellMes += ChatColor.WHITE+"";break;                    
  35.                             case "k": newTellMes += ChatColor.MAGIC+"";break;
  36.                             case "l": newTellMes += ChatColor.BOLD+"";break;
  37.                             case "m": newTellMes += ChatColor.STRIKETHROUGH+"";break;
  38.                             case "n": newTellMes += ChatColor.UNDERLINE+"";break;
  39.                             case "o": newTellMes += ChatColor.ITALIC+"";break;
  40.                             case "r": newTellMes += ChatColor.RESET+"";break;
  41.                             default: newTellMes += token;
  42.                         }
  43.                         begins = false;
  44.                     }
  45.                 }
  46.                 args[0] = newTellMes;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement