This commit is contained in:
fullwall 2012-10-08 11:30:28 +08:00
parent 491f077b4b
commit 091ce13cca
2 changed files with 9 additions and 5 deletions

View File

@ -199,7 +199,7 @@ public class NPCCommands {
}
npc = npcRegistry.createNPC(type, name);
String msg = "You created " + StringHelper.wrap(npc.getName()) + " at your location";
String msg = "You created [[" + npc.getName() + "]] at your location";
int age = 0;
if (args.hasFlag('b')) {

View File

@ -55,10 +55,14 @@ public class Messaging {
String trimmed = message.trim();
String messageColour = StringHelper.parseColors(Setting.MESSAGE_COLOUR.asString());
if (!trimmed.isEmpty()) {
if (trimmed.charAt(0) != ChatColor.COLOR_CHAR)
message = StringHelper.parseColors(Setting.MESSAGE_COLOUR.asString()) + message;
else
messageColour = ChatColor.getByChar(message.substring(1, 2)).toString();
if (trimmed.charAt(0) == ChatColor.COLOR_CHAR) {
ChatColor test = ChatColor.getByChar(trimmed.substring(1, 2));
if (test == null) {
message = messageColour + message;
} else
messageColour = test.toString();
} else
message = messageColour + message;
}
message = message.replace("[[", StringHelper.parseColors(Setting.HIGHLIGHT_COLOUR.asString()));
message = message.replace("]]", messageColour);