geforkt von SteamWar/BungeeCore
Update ServerSwitchCommand
Dieser Commit ist enthalten in:
Ursprung
8a21d5c93d
Commit
160136833e
@ -19,12 +19,13 @@
|
||||
|
||||
package de.steamwar.bungeecore.commands;
|
||||
|
||||
import de.steamwar.command.SWCommand;
|
||||
import net.md_5.bungee.api.CommandSender;
|
||||
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 ServerSwitchCommand extends BasicCommand {
|
||||
public class ServerSwitchCommand extends SWCommand {
|
||||
|
||||
private String serverName;
|
||||
|
||||
@ -33,12 +34,9 @@ public class ServerSwitchCommand extends BasicCommand {
|
||||
serverName = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(CommandSender sender, String[] strings) {
|
||||
if(sender instanceof ProxiedPlayer){
|
||||
ProxiedPlayer player = (ProxiedPlayer) sender;
|
||||
ServerInfo target = ProxyServer.getInstance().getServerInfo(serverName);
|
||||
player.connect(target);
|
||||
}
|
||||
@Register
|
||||
public void genericCommand(ProxiedPlayer player) {
|
||||
ServerInfo target = ProxyServer.getInstance().getServerInfo(serverName);
|
||||
player.connect(target);
|
||||
}
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren