add /language command (#780)

* Fix the following issues:
1. HashMap non-thread-safe issus
2. Fix the same problem in pr621, but use a better implementation

Add the following functions:
1. There is now a language cache inside getLanguage to prepare for different languages corresponding to different time zones where the accounts in the server are located

* add /language command,each account has their own Locate
This commit is contained in:
Secretboy
2022-05-10 20:33:45 +08:00
committed by GitHub
parent 0f1341512c
commit ecf028d0c6
40 changed files with 356 additions and 232 deletions

View File

@@ -14,7 +14,7 @@ public final class ReloadCommand implements CommandHandler {
@Override
public void execute(Player sender, Player targetPlayer, List<String> args) {
CommandHandler.sendMessage(sender, translate("commands.reload.reload_start"));
CommandHandler.sendMessage(sender, translate(sender, "commands.reload.reload_start"));
Grasscutter.loadConfig();
Grasscutter.loadLanguage();
@@ -23,6 +23,6 @@ public final class ReloadCommand implements CommandHandler {
Grasscutter.getGameServer().getShopManager().load();
Grasscutter.getDispatchServer().loadQueries();
CommandHandler.sendMessage(sender, translate("commands.reload.reload_done"));
CommandHandler.sendMessage(sender, translate(sender, "commands.reload.reload_done"));
}
}