summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Essentials/src/com/earth2me/essentials/Essentials.java17
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandbroadcast.java2
2 files changed, 11 insertions, 8 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java
index 4981897e1..2cd6c0c97 100644
--- a/Essentials/src/com/earth2me/essentials/Essentials.java
+++ b/Essentials/src/com/earth2me/essentials/Essentials.java
@@ -619,29 +619,29 @@ public class Essentials extends JavaPlugin implements IEssentials
@Override
public int broadcastMessage(final String message)
{
- return broadcastMessage(null, null, message);
+ return broadcastMessage(null, null, message, true);
}
@Override
public int broadcastMessage(final IUser sender, final String message)
{
- return broadcastMessage(sender, null, message);
+ return broadcastMessage(sender, null, message, false);
}
@Override
public int broadcastMessage(final String permission, final String message)
{
- return broadcastMessage(null, permission, message);
+ return broadcastMessage(null, permission, message, false);
}
- private int broadcastMessage(final IUser sender, final String permission, final String message)
+ private int broadcastMessage(final IUser sender, final String permission, final String message, final boolean keywords)
{
if (sender != null && sender.isHidden())
{
return 0;
}
- final IText input = new SimpleTextInput(message);
+ IText broadcast = new SimpleTextInput(message);
final Player[] players = getServer().getOnlinePlayers();
@@ -651,8 +651,11 @@ public class Essentials extends JavaPlugin implements IEssentials
if ((permission == null && (sender == null || !user.isIgnoredPlayer(sender)))
|| (permission != null && user.isAuthorized(permission)))
{
- final IText output = new KeywordReplacer(input, player, this, false);
- for (String messageText : output.getLines())
+ if (keywords)
+ {
+ broadcast = new KeywordReplacer(broadcast, player, this, false);
+ }
+ for (String messageText : broadcast.getLines())
{
player.sendMessage(messageText);
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbroadcast.java b/Essentials/src/com/earth2me/essentials/commands/Commandbroadcast.java
index 2f9bea293..c68ed5000 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandbroadcast.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandbroadcast.java
@@ -33,6 +33,6 @@ public class Commandbroadcast extends EssentialsCommand
throw new NotEnoughArgumentsException();
}
- ess.broadcastMessage(_("broadcast", FormatUtil.replaceFormat(getFinalArg(args, 0)), name));
+ ess.broadcastMessage(_("broadcast", FormatUtil.replaceFormat(getFinalArg(args, 0)).replace("\\n", "\n"), name));
}
}