mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2026-05-03 11:40:29 +00:00
Add sendtoall command
This commit is contained in:
@@ -33,6 +33,8 @@ class RedisBungeeCommands {
|
||||
new ComponentBuilder("").color(ChatColor.RED).append("You must specify a player name.").create();
|
||||
private static final BaseComponent[] PLAYER_NOT_FOUND =
|
||||
new ComponentBuilder("").color(ChatColor.RED).append("No such player found.").create();
|
||||
private static final BaseComponent[] NO_COMMAND_SPECIFIED =
|
||||
new ComponentBuilder("").color(ChatColor.RED).append("You must specify a command to be run.").create();
|
||||
|
||||
public static class GlistCommand extends Command {
|
||||
GlistCommand() {
|
||||
@@ -144,4 +146,23 @@ class RedisBungeeCommands {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class SendToAll extends Command {
|
||||
SendToAll() {
|
||||
super("sendtoall", "redisbungee.command.sendtoall");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] args) {
|
||||
if (args.length > 0) {
|
||||
String command = Joiner.on(" ").skipNulls().join(args);
|
||||
RedisBungee.getApi().sendProxyCommand(command);
|
||||
TextComponent message = new TextComponent();
|
||||
message.setColor(ChatColor.GREEN);
|
||||
message.setText("Sent the command /" + command + " to all proxies.");
|
||||
} else {
|
||||
sender.sendMessage(NO_COMMAND_SPECIFIED);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user