Fixed whitelist/restricted not working well in groups

This commit is contained in:
ajgeiss0702
2023-06-06 09:09:54 -07:00
parent a99bd73614
commit 80289de371
3 changed files with 7 additions and 2 deletions
@@ -52,8 +52,6 @@ public class CommunicationManager {
if(response == null) return; if(response == null) return;
Debug.info("Responding with " + response);
main.getPlatformMethods().sendPluginMessage( main.getPlatformMethods().sendPluginMessage(
receivingPlayer, receivingPlayer,
s(response.getFrom()), s(response.getFrom()),
@@ -37,6 +37,11 @@ public class DefaultBalancer implements Balancer {
selectednum = online; selectednum = online;
continue; continue;
} }
if(!selected.isJoinable(player) && sv.isJoinable(player)) {
selected = sv;
selectednum = online;
continue;
}
if(selectednum > online && sv.isJoinable(player)) { if(selectednum > online && sv.isJoinable(player)) {
selected = sv; selected = sv;
selectednum = online; selectednum = online;
@@ -122,6 +122,8 @@ public class SpigotMain extends JavaPlugin implements PluginMessageListener,List
ComResponse response = ComResponse.from(subchannel, in); ComResponse response = ComResponse.from(subchannel, in);
responseManager.executeResponse(response); responseManager.executeResponse(response);
} catch (IllegalStateException ignored) {
// This seems to happen often when a player leaves. So, we'll ignore it.
} catch (Exception e) { } catch (Exception e) {
getLogger().log(Level.SEVERE, "Error while processing proxy response " + subchannel + ": ", e); getLogger().log(Level.SEVERE, "Error while processing proxy response " + subchannel + ": ", e);
} }