diff --git a/ant/build_examplemod.xml b/ant/build_examplemod.xml index cc94854..7c07f10 100644 --- a/ant/build_examplemod.xml +++ b/ant/build_examplemod.xml @@ -13,11 +13,11 @@ - + - + diff --git a/ant/buildnumber.txt b/ant/buildnumber.txt index 6e91705..712e8f4 100644 --- a/ant/buildnumber.txt +++ b/ant/buildnumber.txt @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Wed Mar 25 02:56:48 PDT 2015 -build.number=38 +#Sat Apr 04 05:06:49 PDT 2015 +build.number=39 diff --git a/bin/com/kyzeragon/mobcountmod/LiteModMobCounter.class b/bin/com/kyzeragon/mobcountmod/LiteModMobCounter.class index 2dd8967..c37607f 100644 Binary files a/bin/com/kyzeragon/mobcountmod/LiteModMobCounter.class and b/bin/com/kyzeragon/mobcountmod/LiteModMobCounter.class differ diff --git a/java/com/kyzeragon/mobcountmod/LiteModMobCounter.java b/java/com/kyzeragon/mobcountmod/LiteModMobCounter.java index 736a2f9..f69d81e 100644 --- a/java/com/kyzeragon/mobcountmod/LiteModMobCounter.java +++ b/java/com/kyzeragon/mobcountmod/LiteModMobCounter.java @@ -31,7 +31,7 @@ @ExposableOptions(strategy = ConfigStrategy.Versioned, filename="mobcountermod.json") public class LiteModMobCounter implements Tickable, ChatFilter, OutboundChatListener { - private static final boolean staff = true; + private static final boolean staff = false; private static final boolean useOptions = false; private static final boolean rebel = false; private static KeyBinding counterKeyBinding; @@ -70,7 +70,7 @@ else if (this.staff) } @Override - public String getVersion() { return "1.1.0"; } + public String getVersion() { return "1.1.1"; } @Override public void init(File configPath) @@ -144,17 +144,18 @@ public void onTick(Minecraft minecraft, float partialTicks, boolean inGame, bool /** * Client side commands */ + @SuppressWarnings("unused") @Override public void onSendChatMessage(C01PacketChatMessage packet, String message) { String[] tokens = message.split(" "); - if (tokens[0].equalsIgnoreCase("/counter") || tokens[0].equalsIgnoreCase("/count")) + if (tokens[0].equalsIgnoreCase("/counter")) { this.sentCmd = true; if (tokens.length < 2) { - this.logMessage(this.getName() + " [v" + this.getVersion() + "] by Kyzeragon"); - this.logMessage("Type /counter help for commands."); + this.logMessage("§2" + this.getName() + " §8[§2v" + this.getVersion() + "§8] §aby Kyzeragon", false); + this.logMessage("Type §2/counter help §afor commands.", false); return; } if (tokens[1].equalsIgnoreCase("message") || tokens[1].equalsIgnoreCase("m") @@ -162,36 +163,40 @@ public void onSendChatMessage(C01PacketChatMessage packet, String message) { if (tokens.length < 3) { + if (this.toMessage == null) + { + this.logMessage("Not currently notifying any players.", true); + return; + } String toSend = "Currently notifying: "; for (String name : this.toMessage) toSend += name + " "; - this.logMessage(toSend); + this.logMessage(toSend, true); } else if (tokens.length > 3) this.logError("Too many args! Usage: /counter msg clear OR /counter msg [player1[,player2]]]"); else if (tokens[2].equalsIgnoreCase("clear")) { this.toMessage = null; - this.logMessage("Not currently notifying any players."); + this.logMessage("Not currently notifying any players.", true); } else { this.toMessage = tokens[2].split(","); String toSend = tokens[2].replaceAll(",", " "); - this.logMessage("Now notifying: " + toSend); - this.logError("Usage: /counter msg clear OR /counter msg "); + this.logMessage("Now notifying: " + toSend, true); } } else if (tokens[1].equalsIgnoreCase("sound")) { if (tokens.length < 3) - this.logMessage("Current hostile sound: " + this.sound); + this.logMessage("Current hostile sound: " + this.sound, true); else if (tokens.length > 3) this.logError("Too many args! Usage: /counter sound "); else { this.sound = tokens[2]; - this.logMessage("Now using " + this.sound + " as notification sound."); + this.logMessage("Now using " + this.sound + " as notification sound.", true); } } else if (tokens[1].matches("fac|faction")) @@ -201,16 +206,20 @@ else if (tokens[1].matches("fac|faction")) if (tokens[2].equalsIgnoreCase("on")) { this.notifyFac = true; - this.logMessage("Now notifying in faction chat when over 150 mobs."); + this.logMessage("Now notifying in faction chat when over 150 mobs.", true); } else if (tokens[2].equalsIgnoreCase("off")) { this.notifyFac = false; - this.logMessage("Not notifying in faction chat."); + this.logMessage("Not notifying in faction chat.", true); } else this.logError("Usage: /counter fac "); } + else if (this.notifyFac) + this.logMessage("Currently notifying faction chat.", true); + else + this.logMessage("Currently not notifying faction chat.", true); } else if (tokens[1].equalsIgnoreCase("xp5") && this.staff) { @@ -219,13 +228,13 @@ else if (tokens[1].equalsIgnoreCase("xp5") && this.staff) if (tokens[2].equalsIgnoreCase("on")) { this.counter.setXP5(true); - this.logMessage("Now counting only mobs at ShockerzXP5 kill points... mostly."); + this.logMessage("Now counting only mobs at ShockerzXP5 kill points... mostly.", true); return; } else if (tokens[2].equalsIgnoreCase("off")) { this.counter.setXP5(false); - this.logMessage("Using normal mob counter radius."); + this.logMessage("Using normal mob counter radius.", true); return; } } @@ -233,18 +242,18 @@ else if (tokens[2].equalsIgnoreCase("off")) } else if (tokens[1].equalsIgnoreCase("help")) { - String[] commands = {"msg [player1[,player2]] - Set notified players", - "msg clear - Clear the list of notfied players", - "fac|faction - Toggle notification in faction chat.", - "sound [sound file] - Set the notification sound.", - "help - This help message. Hurrdurr."}; - this.logMessage(this.getName() + " [v" + this.getVersion() + "] commands"); + String[] commands = {"msg [player1[,player2]] §7- §aSet notified players", + "msg clear §7- §aClear the list of notfied players", + "fac|faction §7- §aToggle notification in faction chat.", + "sound [sound file] §7- §aSet the notification sound.", + "help §7- §aThis help message. Hurrdurr."}; + this.logMessage("§2" + this.getName() + " §8[§2v" + this.getVersion() + "§8] §acommands", false); for (String command : commands) - this.logMessage("/counter " + command); + this.logMessage("/counter " + command, false); } else { - this.logMessage(this.getName() + " [v" + this.getVersion() + "]"); - this.logMessage("Type /counter help for commands."); + this.logMessage(this.getName() + " [v" + this.getVersion() + "]", false); + this.logMessage("Type /counter help for commands.", false); } } } @@ -445,10 +454,12 @@ private void displayHostile() * Logs the message to the user * @param message The message to log */ - public static void logMessage(String message) + public static void logMessage(String message, boolean usePrefix) { + if (usePrefix) + message = "§8[§2MobCounter§8] §a" + message; ChatComponentText displayMessage = new ChatComponentText(message); - displayMessage.setChatStyle((new ChatStyle()).setColor(EnumChatFormatting.AQUA)); + displayMessage.setChatStyle((new ChatStyle()).setColor(EnumChatFormatting.GREEN)); Minecraft.getMinecraft().thePlayer.addChatComponentMessage(displayMessage); }