diff --git a/src/main/java/com/cnaude/purpleirc/Commands/SMsg.java b/src/main/java/com/cnaude/purpleirc/Commands/SMsg.java index ce67223..8b6e5a5 100644 --- a/src/main/java/com/cnaude/purpleirc/Commands/SMsg.java +++ b/src/main/java/com/cnaude/purpleirc/Commands/SMsg.java @@ -82,7 +82,7 @@ public class SMsg implements IRCCommandInterface { String targetMsg = plugin.tokenizer.gameChatTokenizer(player, template, msg); String responseTemplate = plugin.getMsgTemplate("MAIN", "", TemplateName.GAME_PCHAT_RESPONSE); if (!responseTemplate.isEmpty()) { - String responseMsg = plugin.tokenizer.msgChatResponseTokenizer(player.getName(), responseTemplate, msg); + String responseMsg = plugin.tokenizer.msgChatResponseTokenizer(player, msg, responseTemplate); sender.sendMessage(responseMsg); } plugin.logDebug("Tokenized message: " + targetMsg); diff --git a/src/main/java/com/cnaude/purpleirc/Utilities/ChatTokenizer.java b/src/main/java/com/cnaude/purpleirc/Utilities/ChatTokenizer.java index a189898..0a18e86 100644 --- a/src/main/java/com/cnaude/purpleirc/Utilities/ChatTokenizer.java +++ b/src/main/java/com/cnaude/purpleirc/Utilities/ChatTokenizer.java @@ -328,7 +328,7 @@ public class ChatTokenizer { .replace("%NAME%", pName) .replace("%MESSAGE%", plugin.colorConverter.gameColorsToIrc(message))); } - + /** * Game chat to game (private messages) * @@ -761,4 +761,10 @@ public class ChatTokenizer { .replace("%MESSAGE%", message) ); } + + public String msgChatResponseTokenizer(Player player, String message, String template) { + return template + .replace("%TARGET%", player.getName()) + .replace("%MESSAGE%", message); + } }