diff --git a/vMinecraftChat.java b/vMinecraftChat.java index 95ac83a16..6dc929572 100644 --- a/vMinecraftChat.java +++ b/vMinecraftChat.java @@ -10,6 +10,20 @@ import java.util.logging.Logger; public class vMinecraftChat { protected static final Logger log = Logger.getLogger("Minecraft"); protected static final int lineLength = 312; + //The array of colors to use + protected static final String[] rainbow = new String[] { + Colors.Red, + Colors.Rose, + Colors.Gold, + Colors.Yellow, + Colors.LightGreen, + Colors.Green, + Colors.LightBlue, + Colors.Blue, + Colors.Navy, + Colors.DarkPurple, + Colors.Purple, + Colors.LightPurple}; //===================================================================== //Function: gmsg @@ -18,6 +32,9 @@ public class vMinecraftChat { //Use: Outputs a message to everybody //===================================================================== public static void gmsg(Player sender, String msg){ + if(sender.isMuted()) + sender.sendMessage(Colors.Red + "You have been muted."); + for (Player receiver : etc.getServer().getPlayerList()) { if (receiver == null) {return;} @@ -41,6 +58,9 @@ public class vMinecraftChat { //Use: Outputs a message to everybody //===================================================================== public static void sendMessage(Player sender, Player receiver, String msg){ + if(sender.isMuted()) + sender.sendMessage(Colors.Red + "You have been muted."); + //Check if the receiver has the sender ignored if(vMinecraftUsers.getProfile(receiver) == null) return; @@ -116,11 +136,16 @@ public class vMinecraftChat { //and their following color codes for(int x = 0; x 0) - length += len; - else - x++; + length += len; } return length; } @@ -189,15 +214,11 @@ public class vMinecraftChat { //===================================================================== public static String rainbow(String msg){ String temp = ""; - //The array of colors to use - String[] rainbow = new String[] {Colors.Red, Colors.Rose, Colors.Gold, - Colors.Yellow, Colors.LightGreen, Colors.Green, Colors.Blue, - Colors.Navy, Colors.DarkPurple, Colors.Purple, Colors.LightPurple}; int counter=0; //Loop through the message applying the colors for(int x=0; x