Beispiel #1
0
 public ChatMessage(
     String source, String channel, String playerName, String message, String playeraccount) {
   this.source = source;
   this.playerName = Client.stripColor(playerName);
   this.message = DynmapChatColor.stripColor(message);
   this.account = playeraccount;
   this.channel = channel;
 }
Beispiel #2
0
 public ChatMessage(
     String source, String channel, String playerName, String message, String playeraccount) {
   this.source = source;
   if (ClientUpdateComponent.hideNames) this.playerName = "";
   else if (ClientUpdateComponent.usePlayerColors)
     this.playerName = Client.encodeColorInHTML(playerName);
   else this.playerName = Client.stripColor(playerName);
   this.message = DynmapChatColor.stripColor(message);
   this.account = playeraccount;
   this.channel = channel;
 }
Beispiel #3
0
 public static String stripColor(String s) {
   s = DynmapChatColor.stripColor(s); /* Strip standard color encoding */
   /* Handle Essentials nickname encoding too */
   int idx = 0;
   while ((idx = s.indexOf('&', idx)) >= 0) {
     char c = s.charAt(idx + 1); /* Get next character */
     if (c == '&') {
       /* Another ampersand */
       s = s.substring(0, idx) + s.substring(idx + 1);
     } else {
       s = s.substring(0, idx) + s.substring(idx + 2);
     }
     idx++;
   }
   return s;
 }