Commit d468edcf authored by Akka's avatar Akka
Browse files

merge

parents 4b6842f0 3a5503de
...@@ -11,9 +11,9 @@ import java.util.List; ...@@ -11,9 +11,9 @@ import java.util.List;
import static emu.grasscutter.utils.Language.translate; import static emu.grasscutter.utils.Language.translate;
@Command(label = "heal", usage = "heal|h", aliases = {"h"}, @Command(label = "heal", usage = "heal|h", aliases = {"h"}, permission = "player.heal", description = "commands.heal.description")
description = "Heal all characters in your current team.", permission = "player.heal")
public final class HealCommand implements CommandHandler { public final class HealCommand implements CommandHandler {
@Override @Override
public void execute(Player sender, Player targetPlayer, List<String> args) { public void execute(Player sender, Player targetPlayer, List<String> args) {
if (targetPlayer == null) { if (targetPlayer == null) {
......
...@@ -10,8 +10,7 @@ import java.util.*; ...@@ -10,8 +10,7 @@ import java.util.*;
import static emu.grasscutter.utils.Language.translate; import static emu.grasscutter.utils.Language.translate;
@Command(label = "help", usage = "help [command]", @Command(label = "help", usage = "help [command]", description = "commands.help.description")
description = "Sends the help message or shows information about a specified command")
public final class HelpCommand implements CommandHandler { public final class HelpCommand implements CommandHandler {
@Override @Override
...@@ -39,7 +38,7 @@ public final class HelpCommand implements CommandHandler { ...@@ -39,7 +38,7 @@ public final class HelpCommand implements CommandHandler {
} else { } else {
Command annotation = handler.getClass().getAnnotation(Command.class); Command annotation = handler.getClass().getAnnotation(Command.class);
builder.append(" ").append(annotation.description()).append("\n"); builder.append(" ").append(translate(annotation.description())).append("\n");
builder.append(translate("commands.help.usage")).append(annotation.usage()); builder.append(translate("commands.help.usage")).append(annotation.usage());
if (annotation.aliases().length >= 1) { if (annotation.aliases().length >= 1) {
builder.append("\n").append(translate("commands.help.aliases")); builder.append("\n").append(translate("commands.help.aliases"));
...@@ -61,7 +60,7 @@ public final class HelpCommand implements CommandHandler { ...@@ -61,7 +60,7 @@ public final class HelpCommand implements CommandHandler {
StringBuilder builder = new StringBuilder("\n" + translate("commands.help.available_commands") + "\n"); StringBuilder builder = new StringBuilder("\n" + translate("commands.help.available_commands") + "\n");
annotations.forEach(annotation -> { annotations.forEach(annotation -> {
builder.append(annotation.label()).append("\n"); builder.append(annotation.label()).append("\n");
builder.append(" ").append(annotation.description()).append("\n"); builder.append(" ").append(translate(annotation.description())).append("\n");
builder.append(translate("commands.help.usage")).append(annotation.usage()); builder.append(translate("commands.help.usage")).append(annotation.usage());
if (annotation.aliases().length >= 1) { if (annotation.aliases().length >= 1) {
builder.append("\n").append(translate("commands.help.aliases")); builder.append("\n").append(translate("commands.help.aliases"));
...@@ -78,7 +77,7 @@ public final class HelpCommand implements CommandHandler { ...@@ -78,7 +77,7 @@ public final class HelpCommand implements CommandHandler {
CommandHandler.sendMessage(player, translate("commands.help.available_commands")); CommandHandler.sendMessage(player, translate("commands.help.available_commands"));
annotations.forEach(annotation -> { annotations.forEach(annotation -> {
StringBuilder builder = new StringBuilder(annotation.label()).append("\n"); StringBuilder builder = new StringBuilder(annotation.label()).append("\n");
builder.append(" ").append(annotation.description()).append("\n"); builder.append(" ").append(translate(annotation.description())).append("\n");
builder.append(translate("commands.help.usage")).append(annotation.usage()); builder.append(translate("commands.help.usage")).append(annotation.usage());
if (annotation.aliases().length >= 1) { if (annotation.aliases().length >= 1) {
builder.append("\n").append(translate("commands.help.aliases")); builder.append("\n").append(translate("commands.help.aliases"));
......
...@@ -8,8 +8,7 @@ import java.util.List; ...@@ -8,8 +8,7 @@ import java.util.List;
import static emu.grasscutter.utils.Language.translate; import static emu.grasscutter.utils.Language.translate;
@Command(label = "kick", usage = "kick", @Command(label = "kick", usage = "kick", permission = "server.kick", description = "commands.kick.description")
description = "Kicks the specified player from the server (WIP)", permission = "server.kick")
public final class KickCommand implements CommandHandler { public final class KickCommand implements CommandHandler {
@Override @Override
......
...@@ -12,8 +12,7 @@ import java.util.List; ...@@ -12,8 +12,7 @@ import java.util.List;
import static emu.grasscutter.utils.Language.translate; import static emu.grasscutter.utils.Language.translate;
@Command(label = "killall", usage = "killall [sceneId]", @Command(label = "killall", usage = "killall [sceneId]", permission = "server.killall", description = "commands.kill.description")
description = "Kill all entities", permission = "server.killall")
public final class KillAllCommand implements CommandHandler { public final class KillAllCommand implements CommandHandler {
@Override @Override
......
...@@ -13,8 +13,7 @@ import java.util.List; ...@@ -13,8 +13,7 @@ import java.util.List;
import static emu.grasscutter.utils.Language.translate; import static emu.grasscutter.utils.Language.translate;
@Command(label = "killcharacter", usage = "killcharacter", aliases = {"suicide", "kill"}, @Command(label = "killcharacter", usage = "killcharacter", aliases = {"suicide", "kill"}, permission = "player.killcharacter", description = "commands.list.description")
description = "Kills the players current character", permission = "player.killcharacter")
public final class KillCharacterCommand implements CommandHandler { public final class KillCharacterCommand implements CommandHandler {
@Override @Override
......
...@@ -10,8 +10,7 @@ import java.util.Map; ...@@ -10,8 +10,7 @@ import java.util.Map;
import static emu.grasscutter.utils.Language.translate; import static emu.grasscutter.utils.Language.translate;
@Command(label = "list", usage = "list [uid]", @Command(label = "list", usage = "list [uid]", aliases = {"players"}, description = "commands.list.description")
description = "List online players", aliases = {"players"})
public final class ListCommand implements CommandHandler { public final class ListCommand implements CommandHandler {
@Override @Override
......
...@@ -10,8 +10,7 @@ import java.util.List; ...@@ -10,8 +10,7 @@ import java.util.List;
import static emu.grasscutter.utils.Language.translate; import static emu.grasscutter.utils.Language.translate;
@Command(label = "permission", usage = "permission <add|remove> <permission>", @Command(label = "permission", usage = "permission <add|remove> <permission>", permission = "*", description = "commands.permission.description")
description = "Grants or removes a permission for a user", permission = "*")
public final class PermissionCommand implements CommandHandler { public final class PermissionCommand implements CommandHandler {
@Override @Override
......
...@@ -9,8 +9,7 @@ import java.util.List; ...@@ -9,8 +9,7 @@ import java.util.List;
import static emu.grasscutter.utils.Language.translate; import static emu.grasscutter.utils.Language.translate;
@Command(label = "position", usage = "position", aliases = {"pos"}, @Command(label = "position", usage = "position", aliases = {"pos"}, description = "commands.position.description")
description = "Get coordinates.")
public final class PositionCommand implements CommandHandler { public final class PositionCommand implements CommandHandler {
@Override @Override
......
...@@ -9,8 +9,7 @@ import java.util.List; ...@@ -9,8 +9,7 @@ import java.util.List;
import static emu.grasscutter.utils.Language.translate; import static emu.grasscutter.utils.Language.translate;
@Command(label = "reload", usage = "reload", @Command(label = "reload", usage = "reload", permission = "server.reload", description = "commands.reload.description")
description = "Reload server config", permission = "server.reload")
public final class ReloadCommand implements CommandHandler { public final class ReloadCommand implements CommandHandler {
@Override @Override
......
...@@ -11,8 +11,7 @@ import java.util.List; ...@@ -11,8 +11,7 @@ import java.util.List;
import static emu.grasscutter.utils.Language.translate; import static emu.grasscutter.utils.Language.translate;
@Command(label = "resetconst", usage = "resetconst [all]", @Command(label = "resetconst", usage = "resetconst [all]",
description = "Resets the constellation level on your current active character, will need to relog after using the command to see any changes.", aliases = {"resetconstellation"}, permission = "player.resetconstellation", description = "commands.resetConst.description")
aliases = {"resetconstellation"}, permission = "player.resetconstellation")
public final class ResetConstCommand implements CommandHandler { public final class ResetConstCommand implements CommandHandler {
@Override @Override
......
...@@ -9,9 +9,9 @@ import java.util.List; ...@@ -9,9 +9,9 @@ import java.util.List;
import static emu.grasscutter.utils.Language.translate; import static emu.grasscutter.utils.Language.translate;
@Command(label = "resetshop", usage = "resetshop", @Command(label = "resetshop", usage = "resetshop", permission = "server.resetshop", description = "commands.status.description")
description = "Reset target player's shop refresh time.", permission = "server.resetshop")
public final class ResetShopLimitCommand implements CommandHandler { public final class ResetShopLimitCommand implements CommandHandler {
@Override @Override
public void execute(Player sender, Player targetPlayer, List<String> args) { public void execute(Player sender, Player targetPlayer, List<String> args) {
if (targetPlayer == null) { if (targetPlayer == null) {
......
...@@ -6,7 +6,9 @@ import emu.grasscutter.game.player.Player; ...@@ -6,7 +6,9 @@ import emu.grasscutter.game.player.Player;
import java.util.List; import java.util.List;
@Command(label = "restart", usage = "restart - Restarts the current session") import static emu.grasscutter.utils.Language.translate;
@Command(label = "restart", usage = "restart", description = "commands.restart.description")
public final class RestartCommand implements CommandHandler { public final class RestartCommand implements CommandHandler {
@Override @Override
......
...@@ -13,8 +13,7 @@ import java.util.List; ...@@ -13,8 +13,7 @@ import java.util.List;
import static emu.grasscutter.utils.Language.translate; import static emu.grasscutter.utils.Language.translate;
@SuppressWarnings("ConstantConditions") @SuppressWarnings("ConstantConditions")
@Command(label = "sendmail", usage = "sendmail <userId|all|help> [templateId]", @Command(label = "sendmail", usage = "sendmail <userId|all|help> [templateId]", permission = "server.sendmail", description = "commands.sendMail.description")
description = "Sends mail to the specified user. The usage of this command changes based on it's composition state.", permission = "server.sendmail")
public final class SendMailCommand implements CommandHandler { public final class SendMailCommand implements CommandHandler {
// TODO: You should be able to do /sendmail and then just send subsequent messages until you finish // TODO: You should be able to do /sendmail and then just send subsequent messages until you finish
...@@ -40,7 +39,7 @@ public final class SendMailCommand implements CommandHandler { ...@@ -40,7 +39,7 @@ public final class SendMailCommand implements CommandHandler {
MailBuilder mailBuilder; MailBuilder mailBuilder;
switch (args.get(0).toLowerCase()) { switch (args.get(0).toLowerCase()) {
case "help" -> { case "help" -> {
CommandHandler.sendMessage(sender, this.getClass().getAnnotation(Command.class).description() + "\nUsage: " + this.getClass().getAnnotation(Command.class).usage()); CommandHandler.sendMessage(sender, translate(this.getClass().getAnnotation(Command.class).description()) + "\nUsage: " + this.getClass().getAnnotation(Command.class).usage());
return; return;
} }
case "all" -> mailBuilder = new MailBuilder(true, new Mail()); case "all" -> mailBuilder = new MailBuilder(true, new Mail());
......
...@@ -8,8 +8,8 @@ import java.util.List; ...@@ -8,8 +8,8 @@ import java.util.List;
import static emu.grasscutter.utils.Language.translate; import static emu.grasscutter.utils.Language.translate;
@Command(label = "say", usage = "say <message>", description = "Sends a message to a player as the server", @Command(label = "say", usage = "say <message>",
aliases = {"sendservmsg", "sendservermessage", "sendmessage"}, permission = "server.sendmessage") aliases = {"sendservmsg", "sendservermessage", "sendmessage"}, permission = "server.sendmessage", description = "commands.sendMessage.description")
public final class SendMessageCommand implements CommandHandler { public final class SendMessageCommand implements CommandHandler {
@Override @Override
......
...@@ -12,8 +12,7 @@ import emu.grasscutter.server.packet.send.PacketAvatarFetterDataNotify; ...@@ -12,8 +12,7 @@ import emu.grasscutter.server.packet.send.PacketAvatarFetterDataNotify;
import static emu.grasscutter.utils.Language.translate; import static emu.grasscutter.utils.Language.translate;
@Command(label = "setfetterlevel", usage = "setfetterlevel <level>", @Command(label = "setfetterlevel", usage = "setfetterlevel <level>",
description = "Sets your fetter level for your current active character", aliases = {"setfetterlvl", "setfriendship"}, permission = "player.setfetterlevel", description = "commands.setFetterLevel.description")
aliases = {"setfetterlvl", "setfriendship"}, permission = "player.setfetterlevel")
public final class SetFetterLevelCommand implements CommandHandler { public final class SetFetterLevelCommand implements CommandHandler {
@Override @Override
......
...@@ -15,8 +15,7 @@ import emu.grasscutter.utils.Language; ...@@ -15,8 +15,7 @@ import emu.grasscutter.utils.Language;
import static emu.grasscutter.utils.Language.translate; import static emu.grasscutter.utils.Language.translate;
@Command(label = "setstats", usage = "setstats|stats <stat> <value>", @Command(label = "setstats", usage = "setstats|stats <stat> <value>", aliases = {"stats"}, permission = "player.setstats", description = "commands.setStats.description")
description = "Set fight property for your current active character", aliases = {"stats"}, permission = "player.setstats")
public final class SetStatsCommand implements CommandHandler { public final class SetStatsCommand implements CommandHandler {
static class Stat { static class Stat {
String name; String name;
......
...@@ -10,8 +10,7 @@ import java.util.List; ...@@ -10,8 +10,7 @@ import java.util.List;
import static emu.grasscutter.utils.Language.translate; import static emu.grasscutter.utils.Language.translate;
@Command(label = "setworldlevel", usage = "setworldlevel <level>", @Command(label = "setworldlevel", usage = "setworldlevel <level>",
description = "Sets your world level (Relog to see proper effects)", aliases = {"setworldlvl"}, permission = "player.setworldlevel", description = "commands.setWorldLevel.description")
aliases = {"setworldlvl"}, permission = "player.setworldlevel")
public final class SetWorldLevelCommand implements CommandHandler { public final class SetWorldLevelCommand implements CommandHandler {
@Override @Override
......
...@@ -22,8 +22,7 @@ import java.util.Random; ...@@ -22,8 +22,7 @@ import java.util.Random;
import static emu.grasscutter.utils.Language.translate; import static emu.grasscutter.utils.Language.translate;
@Command(label = "spawn", usage = "spawn <entityId> [amount] [level(monster only)]", @Command(label = "spawn", usage = "spawn <entityId> [amount] [level(monster only)]", permission = "server.spawn", description = "commands.spawn.description")
description = "Spawns an entity near you", permission = "server.spawn")
public final class SpawnCommand implements CommandHandler { public final class SpawnCommand implements CommandHandler {
@Override @Override
......
...@@ -9,8 +9,7 @@ import java.util.List; ...@@ -9,8 +9,7 @@ import java.util.List;
import static emu.grasscutter.utils.Language.translate; import static emu.grasscutter.utils.Language.translate;
@Command(label = "stop", usage = "stop", @Command(label = "stop", usage = "stop", permission = "server.stop", description = "commands.stop.description")
description = "Stops the server", permission = "server.stop")
public final class StopCommand implements CommandHandler { public final class StopCommand implements CommandHandler {
@Override @Override
......
...@@ -14,8 +14,7 @@ import java.util.List; ...@@ -14,8 +14,7 @@ import java.util.List;
import static emu.grasscutter.utils.Language.translate; import static emu.grasscutter.utils.Language.translate;
@Command(label = "talent", usage = "talent <talentID> <value>", @Command(label = "talent", usage = "talent <talentID> <value>", permission = "player.settalent", description = "commands.talent.description")
description = "Set talent level for your current active character", permission = "player.settalent")
public final class TalentCommand implements CommandHandler { public final class TalentCommand implements CommandHandler {
private void setTalentLevel(Player sender, Player player, Avatar avatar, int talentId, int talentLevel) { private void setTalentLevel(Player sender, Player player, Avatar avatar, int talentId, int talentLevel) {
int oldLevel = avatar.getSkillLevelMap().get(talentId); int oldLevel = avatar.getSkillLevelMap().get(talentId);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment