2019-12-17 12:37:59 +00:00
|
|
|
package pw.kaboom.extras.commands;
|
2019-07-30 14:41:54 +00:00
|
|
|
|
|
|
|
import org.bukkit.Bukkit;
|
|
|
|
import org.bukkit.ChatColor;
|
|
|
|
|
|
|
|
import org.bukkit.command.Command;
|
|
|
|
import org.bukkit.command.CommandExecutor;
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
|
2019-12-21 13:39:31 +00:00
|
|
|
public final class CommandConsole implements CommandExecutor {
|
2022-05-20 02:35:48 +00:00
|
|
|
public boolean onCommand(final CommandSender sender, final Command command, final String label, final String[] args) {
|
|
|
|
if (args.length == 0) {
|
|
|
|
sender.sendMessage(ChatColor.RED + "Usage: /" + label + " <message ..>");
|
|
|
|
} else {
|
|
|
|
Bukkit.dispatchCommand(
|
|
|
|
Bukkit.getConsoleSender(),
|
|
|
|
"minecraft:say " + ChatColor.translateAlternateColorCodes('&', String.join(" ", args))
|
|
|
|
);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
2019-07-30 14:41:54 +00:00
|
|
|
}
|