Add messages to reload command

This commit is contained in:
天クマ 2026-05-19 19:48:01 -03:00
commit 1259cd874e
5 changed files with 21 additions and 4 deletions

View file

@ -17,7 +17,11 @@ public enum Messages {
PAY_COULD_NOT_REALIZE_TRANSACTION("pay-could-not-realize-transaction"),
PAY_COULD_NOT_FIND_TARGET("pay-could-not-find-target"),
PAY_NOT_ENOUGH_MONEY("pay-not-enough-money"),
PAY_INVALID_AMOUNT("pay-invalid-amount");
PAY_INVALID_AMOUNT("pay-invalid-amount"),
RELOADING("reloading"),
RELOAD_ERROR("reload-error"),
RELOAD_FINISHED("reload-finished");
private final String path;
Messages(String path) { this.path = path; }

View file

@ -2,6 +2,7 @@ package io.github.adrianvic.itemeconomy.commands;
import io.github.adrianvic.itemeconomy.Config;
import io.github.adrianvic.itemeconomy.Main;
import io.github.adrianvic.itemeconomy.Messages;
import io.github.adrianvic.itemeconomy.UnrealConfig;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
@ -13,9 +14,12 @@ public class Reload implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String @NotNull [] strings) {
try {
commandSender.sendMessage("[ECONOMY] %s".formatted(Messages.RELOADING));
Config.loadConfig(new UnrealConfig(Main.getInstance(), Main.getInstance().getDataFolder(), "config.yml"));
commandSender.sendMessage("[ECONOMY] %s".formatted(Messages.RELOAD_FINISHED));
return true;
} catch (Exception e) {
commandSender.sendMessage("[ECONOMY] %s".formatted(Messages.RELOAD_ERROR));
return false;
}
}

View file

@ -8,3 +8,6 @@ pay-could-not-realize-transaction=pay-could-not-realize-transaction
pay-could-not-find-target=pay-could-not-find-target
pay-not-enough-money=pay-not-enough-money
pay-invalid-amount=pay-invalid-amount
reloading=reloading
reload-error=reload-error
reload-finished=reload-finished

View file

@ -8,3 +8,6 @@ pay-could-not-realize-transaction=Could not realize transaction: %s
pay-could-not-find-target=Could not find target player.
pay-not-enough-money=You don't have enough money.
pay-invalid-amount=The amount you tried to pay is not valid.
reloading=Reloading...
reload-error=Reload complete.
reload-finished=An error occurred while reloading the config, please check your logs.

View file

@ -8,3 +8,6 @@ pay-could-not-realize-transaction=N
pay-could-not-find-target=Não foi possível encontrar o jogador-alvo.
pay-not-enough-money=Você não tem dinheiro suficiente.
pay-invalid-amount=A quantidade que você tentou enviar é inválida.
reloading=Recarregando...
reload-error=Carregamento completo.
reload-finished=Ocorreu um erro ao recarregar, por favor, verifique seu registro.