This commit is contained in:
nossr50 2011-01-05 10:51:43 -08:00
parent af1f52baaf
commit 1fd278a3c9

View File

@ -92,7 +92,6 @@ public class vChat {
+ " has you on their ignore list."); + " has you on their ignore list.");
return; return;
} }
String[] message = applyColors(wordWrap(msg)); String[] message = applyColors(wordWrap(msg));
for(String out : message) for(String out : message)
receiver.sendMessage(out); receiver.sendMessage(out);
@ -172,12 +171,12 @@ public class vChat {
//and their following color codes //and their following color codes
for(int x = 0; x<str.length(); x++) for(int x = 0; x<str.length(); x++)
{ {
if(str.charAt(x) == '^' || str.charAt(x) == Colors.White.charAt(0)) if((x+1 <= str.length()) && (str.charAt(x) == '^' || str.charAt(x) == Colors.White.charAt(0)))
{ {
if(colorChange(str.charAt(x + 1)) != null) if(colorChange(str.charAt(x + 1)) != null)
{ {
x++; x++;
continue; continue;
} }
} }
int len = charLength(str.charAt(x)); int len = charLength(str.charAt(x));
@ -321,7 +320,7 @@ public class vChat {
//===================================================================== //=====================================================================
public static String colorChange(char colour) public static String colorChange(char colour)
{ {
String color = ""; String color;
switch(colour) switch(colour)
{ {
case '0': case '0':
@ -344,7 +343,7 @@ public class vChat {
break; break;
case '6': case '6':
color = Colors.Gold; color = Colors.Gold;
break; break;
case '7': case '7':
color = Colors.LightGray; color = Colors.LightGray;
break; break;
@ -402,11 +401,11 @@ public class vChat {
case 'X': case 'X':
color = "^x"; color = "^x";
break; break;
default: default:
color = null; color = null;
break; break;
} }
return color; return color;
} }
//===================================================================== //=====================================================================