From 9688c3895437648538c24b61d163f50a899288c6 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 19 Jan 2024 16:44:52 +0100 Subject: [PATCH] Revert ServerStarter.builder startCondition --- src/de/steamwar/bungeecore/ServerStarter.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/de/steamwar/bungeecore/ServerStarter.java b/src/de/steamwar/bungeecore/ServerStarter.java index 5a5a7197..fdea7c1c 100644 --- a/src/de/steamwar/bungeecore/ServerStarter.java +++ b/src/de/steamwar/bungeecore/ServerStarter.java @@ -131,16 +131,17 @@ public class ServerStarter { // Send players to existing server startCondition = () -> { - boolean atLeastOneSupervisor = playersToSend.stream().anyMatch(player -> { - BauweltMember bauweltMember = BauweltMember.getBauMember(owner, player.getUniqueId()); - return bauweltMember.isSupervisor() || player.getUniqueId().equals(owner); - }); Bauserver subserver = Bauserver.get(owner); if(subserver != null) { for(ProxiedPlayer p : playersToSend) SubserverSystem.sendPlayer(subserver, p); return false; } + boolean atLeastOneSupervisor = playersToSend.stream().anyMatch(player -> { + if (player.getUniqueId().equals(owner)) return true; + BauweltMember bauweltMember = BauweltMember.getBauMember(owner, player.getUniqueId()); + return bauweltMember.isSupervisor(); + }); if (!atLeastOneSupervisor) { for (ProxiedPlayer p : playersToSend) { ChatSender.of(p).system("BAU_START_NOT_ALLOWED"); @@ -198,12 +199,11 @@ public class ServerStarter { // Send players to existing server startCondition = () -> { - for(Subserver subserver : Subserver.getServerList()) { - if(subserver.getType() == Servertype.BUILDER && ((Builderserver)subserver).getMap().equals(worldName)) { - for(ProxiedPlayer p : playersToSend) - SubserverSystem.sendPlayer(subserver, p); - return false; - } + Builderserver subserver = Builderserver.get(worldName); + if (subserver != null) { + for(ProxiedPlayer p : playersToSend) + SubserverSystem.sendPlayer(subserver, p); + return false; } return true; };