Dieser Commit ist enthalten in:
Ursprung
8823368f0d
Commit
ae2a1d5779
@ -19,30 +19,26 @@
|
|||||||
|
|
||||||
package de.steamwar.bungeecore.commands;
|
package de.steamwar.bungeecore.commands;
|
||||||
|
|
||||||
import de.steamwar.bungeecore.Message;
|
|
||||||
import de.steamwar.bungeecore.Servertype;
|
import de.steamwar.bungeecore.Servertype;
|
||||||
import de.steamwar.bungeecore.Subserver;
|
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.ProxyServer;
|
||||||
import net.md_5.bungee.api.config.ServerInfo;
|
import net.md_5.bungee.api.config.ServerInfo;
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
|
|
||||||
public class ArenaCommand extends BasicCommand {
|
public class ArenaCommand extends SWCommand {
|
||||||
|
|
||||||
public ArenaCommand() {
|
public ArenaCommand() {
|
||||||
super("arena", null);
|
super("arena");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Register
|
||||||
public void execute(CommandSender sender, String[] args) {
|
public void arenaJoin(ProxiedPlayer player, String... serverInfo) {
|
||||||
if(!(sender instanceof ProxiedPlayer))
|
ServerInfo server = ProxyServer.getInstance().getServerInfo(String.join(" ", serverInfo));
|
||||||
return;
|
|
||||||
ProxiedPlayer player = (ProxiedPlayer) sender;
|
|
||||||
|
|
||||||
ServerInfo server = ProxyServer.getInstance().getServerInfo(String.join(" ", args));
|
|
||||||
Subserver subserver = Subserver.getSubserver(server);
|
Subserver subserver = Subserver.getSubserver(server);
|
||||||
if(server == null || subserver == null || subserver.getType() != Servertype.ARENA) {
|
if(server == null || subserver == null || subserver.getType() != Servertype.ARENA) {
|
||||||
Message.send("ARENA_NOT_FOUND", player);
|
ChatSender.of(player).system("ARENA_NOT_FOUND");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren