From 50dca9abf54d5a21d8e3fd79dfd7844d2d21f86c Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sun, 20 Jan 2013 20:54:44 +0000 Subject: [PATCH] Add optional 2nd arg to broadcast format. --- .../essentials/commands/Commandbroadcast.java | 14 +++++++++++++- Essentials/src/plugin.yml | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandbroadcast.java b/Essentials/src/com/earth2me/essentials/commands/Commandbroadcast.java index e6eeda28b..2b588d684 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandbroadcast.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandbroadcast.java @@ -1,6 +1,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; +import com.earth2me.essentials.User; import com.earth2me.essentials.Util; import org.bukkit.Server; import org.bukkit.command.CommandSender; @@ -13,6 +14,17 @@ public class Commandbroadcast extends EssentialsCommand super("broadcast"); } + @Override + public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception + { + if (args.length < 1) + { + throw new NotEnoughArgumentsException(); + } + + ess.broadcastMessage(null, _("broadcast", Util.replaceFormat(getFinalArg(args, 0)), user.getDisplayName())); + } + @Override public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception { @@ -21,6 +33,6 @@ public class Commandbroadcast extends EssentialsCommand throw new NotEnoughArgumentsException(); } - ess.broadcastMessage(null, _("broadcast", Util.replaceFormat(getFinalArg(args, 0)))); + ess.broadcastMessage(null, _("broadcast", Util.replaceFormat(getFinalArg(args, 0)), sender.getName())); } } diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index 753c9a41e..f0aa663ba 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -50,7 +50,7 @@ commands: broadcast: description: Broadcasts a message to the entire server. usage: / - aliases: [ebroadcast,bcast,ebcast] + aliases: [ebroadcast,shout,eshout,bc,ebc,bcast,ebcast] bigtree: description: Spawn a big tree where you are looking. usage: /