#Stop remake

1 messages · Page 1 of 1 (latest)

oblique blade
#

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()
        }
    }
}
reef badge
#

why are you remaking the stop just make a new command that kicks after a period

#

why do u need all this connection stuff

frosty harness
reef badge
#

like /reboot <time>

#

kick players after time, then restart server?

clever scroll
#

he wants to move the players to another server; not kick them

reef badge
#

oh i see

#

then hook onto bungee api and send players before server stop

oblique blade
#

yes

#

for now it kicks them

reef badge
#

theres a bungee /send command, im sure they provide internal methods

#

for that

oblique blade
#

mmmh

#

i'll look into that

reef badge
#

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

oblique blade
#

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 :/

reef badge
#

maybe just dispatch stop through consolesender lmfao

#

idk

frosty harness
#

Make another command not /stop

reef badge
#

thats the easiest way i can think of

#

what 💀

#

this isnt even ur thread

frosty harness
#

Like /hstop

reef badge
#

ur not seeing the point, this is already inside his new command

#

can u stop making pointless statements