1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-06 14:46:32 +02:00

Add optional 2nd arg to broadcast format.

50dca9abf5
This commit is contained in:
Chris Ward
2013-12-01 17:33:44 +11:00
parent e49b2c5508
commit b42b5eadc9
2 changed files with 17 additions and 3 deletions

View File

@@ -1,12 +1,26 @@
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
{
@@ -14,6 +28,6 @@ public class Commandbroadcast extends EssentialsCommand
{
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()));
}
}

View File

@@ -50,7 +50,7 @@ commands:
broadcast:
description: Broadcasts a message to the entire server.
usage: /<command> <msg>
aliases: [ebroadcast,bcast,ebcast]
aliases: [ebroadcast,bcast,ebcast,shout,eshout,bc,ebc]
bigtree:
description: Spawn a big tree where you are looking.
usage: /<command> <tree|redwood|jungle>