SteamWar/BungeeCore
Archiviert
13
2

Update ArenaCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2022-06-14 20:10:07 +02:00
Ursprung 8823368f0d
Commit ae2a1d5779

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