Merge branch 'staggered-lobby-join'
Dieser Commit ist enthalten in:
Commit
1a58849358
@ -46,7 +46,17 @@ public class IFightSystem {
|
||||
public static void shutdown(String reason){
|
||||
if(reason != null)
|
||||
Bukkit.broadcastMessage(reason);
|
||||
Bukkit.getOnlinePlayers().forEach(player -> player.kickPlayer(null));
|
||||
//Staggered kick to prevent lobby overloading
|
||||
kickNext();
|
||||
}
|
||||
|
||||
private static void kickNext(){
|
||||
if(Bukkit.getOnlinePlayers().isEmpty()){
|
||||
Bukkit.shutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
Bukkit.getOnlinePlayers().iterator().next().kickPlayer(null);
|
||||
Bukkit.getScheduler().runTaskLater(plugin, IFightSystem::kickNext, 10);
|
||||
}
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren