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/
|
out/
|
||||||
.idea/
|
.idea/
|
||||||
libs/
|
libs/
|
||||||
|
run/
|
||||||
|
|
@ -106,4 +106,4 @@ tasks.withType<JavaCompile> {
|
||||||
|
|
||||||
tasks.runServer {
|
tasks.runServer {
|
||||||
minecraftVersion("1.21")
|
minecraftVersion("1.21")
|
||||||
}
|
}
|
||||||
|
|
@ -9,17 +9,21 @@ import org.bukkit.command.CommandExecutor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
public class Reload implements CommandExecutor {
|
public class Reload implements CommandExecutor {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String @NotNull [] strings) {
|
public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String @NotNull [] strings) {
|
||||||
|
Locale locale = Utils.localeOrDefault(commandSender);
|
||||||
try {
|
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"));
|
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;
|
return true;
|
||||||
} catch (Exception e) {
|
} 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;
|
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-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...
|
reloading=Reloading...
|
||||||
reload-error=Reload complete.
|
reload-error=An error occurred while reloading the config, please check your logs.
|
||||||
reload-finished=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-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...
|
reloading=Recarregando...
|
||||||
reload-error=Carregamento completo.
|
reload-error=Ocorreu um erro ao recarregar, por favor, verifique seu registro.
|
||||||
reload-finished=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