Fix messages in reload command

This commit is contained in:
天クマ 2026-05-19 20:31:01 -03:00
commit 97f16f98c7
5 changed files with 13 additions and 8 deletions

View file

@ -9,17 +9,21 @@ import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
import java.util.Locale;
public class Reload implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String @NotNull [] strings) {
Locale locale = Utils.localeOrDefault(commandSender);
try {
commandSender.sendMessage("[ECONOMY] %s".formatted(Messages.RELOADING));
commandSender.sendMessage("[ECONOMY] %s".formatted(Messages.RELOADING.get(locale)));
Config.loadConfig(new UnrealConfig(Main.getInstance(), Main.getInstance().getDataFolder(), "config.yml"));
commandSender.sendMessage("[ECONOMY] %s".formatted(Messages.RELOAD_FINISHED));
commandSender.sendMessage("[ECONOMY] %s".formatted(Messages.RELOAD_FINISHED.get(locale)));
return true;
} catch (Exception e) {
commandSender.sendMessage("[ECONOMY] %s".formatted(Messages.RELOAD_ERROR));
commandSender.sendMessage("[ECONOMY] %s".formatted(Messages.RELOAD_ERROR.get(locale)));
e.printStackTrace();
return false;
}
}