SteamWar/BungeeCore
Archiviert
13
2

CommandArena #373

Zusammengeführt
Lixfel hat 5 Commits von CommandArena nach master 2022-07-22 08:53:22 +02:00 zusammengeführt
Nur Änderungen aus Commit ae2a1d5779 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -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;
}