Merge pull request 'Update ServerSwitchCommand' (#399) from CommandServerSwitch into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: #399 Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
Commit
f00d1dc540
@ -19,12 +19,13 @@
|
|||||||
|
|
||||||
package de.steamwar.bungeecore.commands;
|
package de.steamwar.bungeecore.commands;
|
||||||
|
|
||||||
|
import de.steamwar.command.SWCommand;
|
||||||
import net.md_5.bungee.api.CommandSender;
|
import net.md_5.bungee.api.CommandSender;
|
||||||
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 ServerSwitchCommand extends BasicCommand {
|
public class ServerSwitchCommand extends SWCommand {
|
||||||
|
|
||||||
private String serverName;
|
private String serverName;
|
||||||
|
|
||||||
@ -33,12 +34,9 @@ public class ServerSwitchCommand extends BasicCommand {
|
|||||||
serverName = name;
|
serverName = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Register
|
||||||
public void execute(CommandSender sender, String[] strings) {
|
public void genericCommand(ProxiedPlayer player) {
|
||||||
if(sender instanceof ProxiedPlayer){
|
|
||||||
ProxiedPlayer player = (ProxiedPlayer) sender;
|
|
||||||
ServerInfo target = ProxyServer.getInstance().getServerInfo(serverName);
|
ServerInfo target = ProxyServer.getInstance().getServerInfo(serverName);
|
||||||
player.connect(target);
|
player.connect(target);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren