mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-12 06:02:59 +08:00
80db118f72
Change target perm from target.perm to x.perm.others
30 lines
1.2 KiB
Java
30 lines
1.2 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 = "say", usage = "say <message>",
|
|
aliases = {"sendservmsg", "sendservermessage", "sendmessage"}, 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 (targetPlayer == null) {
|
|
CommandHandler.sendMessage(sender, translate("commands.execution.need_target"));
|
|
return;
|
|
}
|
|
if (args.size() == 0) {
|
|
CommandHandler.sendMessage(null, translate("commands.sendMessage.usage"));
|
|
return;
|
|
}
|
|
|
|
String message = String.join(" ", args);
|
|
CommandHandler.sendMessage(targetPlayer, message);
|
|
CommandHandler.sendMessage(sender, translate("commands.sendMessage.success"));
|
|
}
|
|
} |