#Stop remake
1 messages · Page 1 of 1 (latest)
I have for now this command:
public class StopCommand extends Command {
public StopCommand() {
super("stop");
}
@Override
public void execute(CommandSender commandSender, String[] args) {
ProxiedPlayer player = (ProxiedPlayer) commandSender;
List<ProxiedPlayer> players = (List<ProxiedPlayer>) player.getServer().getInfo().getPlayers();
if (!player.getServer().getInfo().getName().equalsIgnoreCase("hub")) {
ServerInfo hub = Main.getInstance().getProxy().getServerInfo("hub");
for (ProxiedPlayer proxiedPlayer : players) {proxiedPlayer.connect(hub);}
player.getServer()
}
}
}
why are you remaking the stop just make a new command that kicks after a period
why do u need all this connection stuff
Players will be kicked before plugins disabled
he wants to move the players to another server; not kick them
basically just do a send all to whaterver server you want, then maybe wait a second using a runnable if need be, then restart the server normally
this part shouldn't be the issue, if you look at the code, normally i have a list of all connected players and i send them onto the "hub" server
but the issue is after
how do i restart the server
through the api?
i've make searches, but google gives me nothing :/
Make another command not /stop
Like /hstop