Remove external shutdown #484
@ -309,8 +309,6 @@ public class BungeeCore extends Plugin {
|
||||
EVENT_MODE = config.getBoolean("eventmode");
|
||||
Broadcaster.setBroadCastMsgs(config.getStringList("broadcasts").toArray(new String[1]));
|
||||
PollSystem.init(config.getString("poll.question"), config.getStringList("poll.answers"));
|
||||
Persistent.setChatPrefix(CHAT_PREFIX);
|
||||
Persistent.setLobbyServer(LOBBY_SERVER);
|
||||
|
||||
final Configuration servers = config.getSection("servers");
|
||||
for(final String serverName : servers.getKeys()){
|
||||
|
@ -39,11 +39,13 @@ import net.md_5.bungee.api.config.ServerInfo;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import net.md_5.bungee.api.event.PlayerDisconnectEvent;
|
||||
import net.md_5.bungee.api.event.PostLoginEvent;
|
||||
import net.md_5.bungee.api.event.ServerDisconnectEvent;
|
||||
import net.md_5.bungee.api.event.ServerKickEvent;
|
||||
import net.md_5.bungee.event.EventHandler;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
public class ConnectionListener extends BasicListener {
|
||||
|
||||
@ -153,17 +155,4 @@ public class ConnectionListener extends BasicListener {
|
||||
Utils.playerModMap.remove(e.getPlayer().getUniqueId());
|
||||
ModCommand.playerFilterType.remove(e.getPlayer());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onServerDisconnect(ServerDisconnectEvent e){
|
||||
ServerInfo server = e.getTarget();
|
||||
Subserver subserver = Subserver.getSubserver(server);
|
||||
if(subserver == null)
|
||||
return;
|
||||
|
||||
ProxiedPlayer player = e.getPlayer();
|
||||
Collection<ProxiedPlayer> players = server.getPlayers();
|
||||
if(players.isEmpty() || (players.size() == 1 && players.contains(player)))
|
||||
ProxyServer.getInstance().getScheduler().runAsync(BungeeCore.get(), subserver::waitForTermination);
|
||||
}
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren