From ae2a1d5779ebd65b4ed5f61cba1f01037c3bda9b Mon Sep 17 00:00:00 2001 From: yoyosource Date: Tue, 14 Jun 2022 20:10:07 +0200 Subject: [PATCH] Update ArenaCommand --- .../bungeecore/commands/ArenaCommand.java | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/ArenaCommand.java b/src/de/steamwar/bungeecore/commands/ArenaCommand.java index 339c66a..929510f 100644 --- a/src/de/steamwar/bungeecore/commands/ArenaCommand.java +++ b/src/de/steamwar/bungeecore/commands/ArenaCommand.java @@ -19,30 +19,26 @@ package de.steamwar.bungeecore.commands; -import de.steamwar.bungeecore.Message; import de.steamwar.bungeecore.Servertype; import de.steamwar.bungeecore.Subserver; -import net.md_5.bungee.api.CommandSender; +import de.steamwar.command.SWCommand; +import de.steamwar.messages.ChatSender; import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.config.ServerInfo; import net.md_5.bungee.api.connection.ProxiedPlayer; -public class ArenaCommand extends BasicCommand { +public class ArenaCommand extends SWCommand { public ArenaCommand() { - super("arena", null); + super("arena"); } - @Override - public void execute(CommandSender sender, String[] args) { - if(!(sender instanceof ProxiedPlayer)) - return; - ProxiedPlayer player = (ProxiedPlayer) sender; - - ServerInfo server = ProxyServer.getInstance().getServerInfo(String.join(" ", args)); + @Register + public void arenaJoin(ProxiedPlayer player, String... serverInfo) { + ServerInfo server = ProxyServer.getInstance().getServerInfo(String.join(" ", serverInfo)); Subserver subserver = Subserver.getSubserver(server); if(server == null || subserver == null || subserver.getType() != Servertype.ARENA) { - Message.send("ARENA_NOT_FOUND", player); + ChatSender.of(player).system("ARENA_NOT_FOUND"); return; }