mirror of
https://github.com/essentials/Essentials.git
synced 2025-02-24 08:22:56 +01:00
Add optional 2nd arg to broadcast format.
This commit is contained in:
parent
3f38677952
commit
d9ab62fe98
@ -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()));
|
||||
}
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ commands:
|
||||
broadcast:
|
||||
description: Broadcasts a message to the entire server.
|
||||
usage: /<command> <msg>
|
||||
aliases: [ebroadcast,bcast,ebcast]
|
||||
aliases: [ebroadcast,shout,eshout,bc,ebc,bcast,ebcast]
|
||||
bigtree:
|
||||
description: Spawn a big tree where you are looking.
|
||||
usage: /<command> <tree|redwood|jungle>
|
||||
|
Loading…
x
Reference in New Issue
Block a user