ServerControl was broken, yet again (#10661)
This commit is contained in:
@@ -248,6 +248,21 @@ public class ServerControl implements ApplicationListener{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(state.isGame()){ //run this only if the server's actually hosting
|
||||
if(Config.autoPause.bool()){
|
||||
if(Groups.player.isEmpty()){
|
||||
autoPaused = true;
|
||||
state.set(State.paused);
|
||||
}else if(autoPaused){
|
||||
autoPaused = false;
|
||||
state.set(State.playing);
|
||||
}
|
||||
}else if(autoPaused && Vars.state.isPaused()){ //unpause when the config is disabled
|
||||
state.set(State.playing);
|
||||
autoPaused = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Events.run(Trigger.socketConfigChanged, () -> {
|
||||
@@ -259,21 +274,6 @@ public class ServerControl implements ApplicationListener{
|
||||
autoPaused = false;
|
||||
});
|
||||
|
||||
Events.run(Trigger.update, () -> {
|
||||
if(Config.autoPause.bool()){
|
||||
if(Groups.player.isEmpty()){
|
||||
autoPaused = true;
|
||||
state.set(State.paused);
|
||||
}else if(autoPaused){
|
||||
autoPaused = false;
|
||||
state.set(State.playing);
|
||||
}
|
||||
}else if(autoPaused && Vars.state.isPaused()){ //unpause when the config is disabled
|
||||
state.set(State.playing);
|
||||
autoPaused = false;
|
||||
}
|
||||
});
|
||||
|
||||
Events.on(PlayEvent.class, e -> {
|
||||
try{
|
||||
JsonValue value = JsonIO.json.fromJson(null, Core.settings.getString("globalrules"));
|
||||
|
||||
Reference in New Issue
Block a user