diff options
author | Chris Ward <chris@chrisgward.com> | 2013-12-01 17:33:44 +1100 |
---|---|---|
committer | Chris Ward <chris@chrisgward.com> | 2013-12-01 17:33:44 +1100 |
commit | b42b5eadc9cc4495a1699c9982b4bd6b48e6e055 (patch) | |
tree | 688e86aa050a6a61e34699349bcbb7a061bae793 /Essentials/src/net/ess3 | |
parent | e49b2c5508840e5a07a46295ff9a859ab5140198 (diff) | |
download | Essentials-b42b5eadc9cc4495a1699c9982b4bd6b48e6e055.tar Essentials-b42b5eadc9cc4495a1699c9982b4bd6b48e6e055.tar.gz Essentials-b42b5eadc9cc4495a1699c9982b4bd6b48e6e055.tar.lz Essentials-b42b5eadc9cc4495a1699c9982b4bd6b48e6e055.tar.xz Essentials-b42b5eadc9cc4495a1699c9982b4bd6b48e6e055.zip |
Add optional 2nd arg to broadcast format.
50dca9abf54d5a2
Diffstat (limited to 'Essentials/src/net/ess3')
-rw-r--r-- | Essentials/src/net/ess3/commands/Commandbroadcast.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/Essentials/src/net/ess3/commands/Commandbroadcast.java b/Essentials/src/net/ess3/commands/Commandbroadcast.java index 52854ce87..4519eef86 100644 --- a/Essentials/src/net/ess3/commands/Commandbroadcast.java +++ b/Essentials/src/net/ess3/commands/Commandbroadcast.java @@ -1,19 +1,33 @@ package net.ess3.commands; -import static net.ess3.I18n._; +import net.ess3.api.IUser; import net.ess3.utils.FormatUtil; +import org.bukkit.command.Command; import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +import static net.ess3.I18n._; public class Commandbroadcast extends EssentialsCommand { @Override + public void run(final IUser user, final String commandLabel, final String[] args) throws Exception + { + if (args.length < 1) + { + throw new NotEnoughArgumentsException(); + } + ess.broadcastMessage(null, _("§r§6[§4Broadcast§6]§a {0}", FormatUtil.replaceFormat(getFinalArg(args, 0)), user.getPlayer().getDisplayName())); + } + + @Override public void run(final CommandSender sender, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { throw new NotEnoughArgumentsException(); } - ess.broadcastMessage(null, _("§r§6[§4Broadcast§6]§a {0}", FormatUtil.replaceFormat(getFinalArg(args, 0)))); + ess.broadcastMessage(null, _("§r§6[§4Broadcast§6]§a {0}", FormatUtil.replaceFormat(getFinalArg(args, 0)), sender.getName())); } } |