Add messages to reload command
This commit is contained in:
parent
f65c3ddc97
commit
1259cd874e
5 changed files with 21 additions and 4 deletions
|
|
@ -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; }
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,4 +7,7 @@ pay-received=pay-received
|
|||
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
|
||||
|
|
@ -7,4 +7,7 @@ pay-received=You received %s from %s.
|
|||
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.
|
||||
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.
|
||||
|
|
@ -7,4 +7,7 @@ pay-received=Voc
|
|||
pay-could-not-realize-transaction=Não foi possível realizar a transação: %s
|
||||
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.
|
||||
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.
|
||||
Loading…
Add table
Add a link
Reference in a new issue