From 4cd0150042ed597c7f310bbe60edbb14f7a51e00 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 16 Jun 2022 11:19:03 +0200 Subject: [PATCH] Update SetLocaleCommand --- .../bungeecore/commands/SetLocaleCommand.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/SetLocaleCommand.java b/src/de/steamwar/bungeecore/commands/SetLocaleCommand.java index 9ffbcbc..798a58c 100644 --- a/src/de/steamwar/bungeecore/commands/SetLocaleCommand.java +++ b/src/de/steamwar/bungeecore/commands/SetLocaleCommand.java @@ -19,25 +19,22 @@ package de.steamwar.bungeecore.commands; +import de.steamwar.command.SWCommand; import de.steamwar.messages.ChatSender; -import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.connection.ProxiedPlayer; import java.util.Objects; -public class SetLocaleCommand extends BasicCommand { +public class SetLocaleCommand extends SWCommand { public SetLocaleCommand() { super("setlocale", null, "setlanguage"); } - @Override - public void execute(CommandSender s, String[] strings) { - if (!(s instanceof ProxiedPlayer)) - return; - - ChatSender sender = ChatSender.of(s); - sender.user().setLocale(Objects.requireNonNull(((ProxiedPlayer) s).getLocale()), true); + @Register + public void genericCommand(ProxiedPlayer player) { + ChatSender sender = ChatSender.of(player); + sender.user().setLocale(Objects.requireNonNull(player.getLocale()), true); sender.system("LOCK_LOCALE_CHANGED"); } } -- 2.39.2