Grasscutter/src/main/java/emu/grasscutter/command/commands/SendMessageCommand.java
AZthemute 06546707e1 Fixed sendmessage command output.
Also clarified coop command in help command.
2022-06-03 19:11:47 -07:00

27 lines
1.0 KiB
Java

package emu.grasscutter.command.commands;
import emu.grasscutter.command.Command;
import emu.grasscutter.command.CommandHandler;
import emu.grasscutter.game.player.Player;
import java.util.List;
import static emu.grasscutter.utils.Language.translate;
@Command(label = "sendmessage", usage = "sendmessage <message>",
aliases = {"say", "sendservmsg", "sendservermessage"}, permission = "server.sendmessage", permissionTargeted = "server.sendmessage.others", description = "commands.sendMessage.description")
public final class SendMessageCommand implements CommandHandler {
@Override
public void execute(Player sender, Player targetPlayer, List<String> args) {
if (args.size() == 0) {
CommandHandler.sendMessage(sender, translate(sender, "commands.sendMessage.usage"));
return;
}
String message = String.join(" ", args);
CommandHandler.sendMessage(targetPlayer, message);
CommandHandler.sendMessage(sender, translate(sender, "commands.sendMessage.success"));
}
}