Fix messages in reload command
This commit is contained in:
parent
074f40abdc
commit
97f16f98c7
5 changed files with 13 additions and 8 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -3,3 +3,4 @@ build/
|
|||
out/
|
||||
.idea/
|
||||
libs/
|
||||
run/
|
||||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,5 +9,5 @@ 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.
|
||||
reload-error=An error occurred while reloading the config, please check your logs.
|
||||
reload-finished=Reload complete.
|
||||
|
|
@ -9,5 +9,5 @@ pay-could-not-find-target=N
|
|||
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.
|
||||
reload-error=Ocorreu um erro ao recarregar, por favor, verifique seu registro.
|
||||
reload-finished=Carregamento completo.
|
||||
Loading…
Add table
Add a link
Reference in a new issue