SteamWar/BungeeCore
Archiviert
13
2

Merge pull request 'Update SetLocaleCommand' (#401) from CommandSetLocale into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Reviewed-on: #401
Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
Lixfel 2022-06-16 13:26:27 +02:00
Commit 01c721a753

Datei anzeigen

@ -19,25 +19,22 @@
package de.steamwar.bungeecore.commands; package de.steamwar.bungeecore.commands;
import de.steamwar.command.SWCommand;
import de.steamwar.messages.ChatSender; import de.steamwar.messages.ChatSender;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.util.Objects; import java.util.Objects;
public class SetLocaleCommand extends BasicCommand { public class SetLocaleCommand extends SWCommand {
public SetLocaleCommand() { public SetLocaleCommand() {
super("setlocale", null, "setlanguage"); super("setlocale", null, "setlanguage");
} }
@Override @Register
public void execute(CommandSender s, String[] strings) { public void genericCommand(ProxiedPlayer player) {
if (!(s instanceof ProxiedPlayer)) ChatSender sender = ChatSender.of(player);
return; sender.user().setLocale(Objects.requireNonNull(player.getLocale()), true);
ChatSender sender = ChatSender.of(s);
sender.user().setLocale(Objects.requireNonNull(((ProxiedPlayer) s).getLocale()), true);
sender.system("LOCK_LOCALE_CHANGED"); sender.system("LOCK_LOCALE_CHANGED");
} }
} }