I forgot this wasn't Apache's StringUtils

This commit is contained in:
Maxetto 2018-02-28 18:25:50 +01:00 committed by GitHub
parent 430716b206
commit 3541f21985
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,7 +53,7 @@ public class Messages {
public void send(CommandSender sender, MessageKey key) { public void send(CommandSender sender, MessageKey key) {
String[] lines = retrieve(key); String[] lines = retrieve(key);
for (String line : lines) { for (String line : lines) {
sender.sendMessage(line.replace(PLAYER_TAG, sender.getName())); sender.sendMessage(line.replaceAll(PLAYER_TAG, sender.getName()));
} }
} }
@ -67,7 +67,7 @@ public class Messages {
* @param replacements The replacements to apply for the tags * @param replacements The replacements to apply for the tags
*/ */
public void send(CommandSender sender, MessageKey key, String... replacements) { public void send(CommandSender sender, MessageKey key, String... replacements) {
String message = retrieveSingle(key, replacements).replace(PLAYER_TAG, sender.getName()); String message = retrieveSingle(key, replacements).replaceAll(PLAYER_TAG, sender.getName());
for (String line : message.split("\n")) { for (String line : message.split("\n")) {
sender.sendMessage(line); sender.sendMessage(line);
} }