diff --git a/src/main/java/net/pistonmaster/pistonqueue/bungee/PistonQueueBungee.java b/src/main/java/net/pistonmaster/pistonqueue/bungee/PistonQueueBungee.java index d864545..e5db4cd 100644 --- a/src/main/java/net/pistonmaster/pistonqueue/bungee/PistonQueueBungee.java +++ b/src/main/java/net/pistonmaster/pistonqueue/bungee/PistonQueueBungee.java @@ -243,10 +243,13 @@ private void sendCustomData() { private void initializeReservationSlots() { getProxy().getScheduler().schedule(this, () -> { - ServerInfo mainServer = getProxy().getServerInfo(Config.MAINSERVER); + Optional mainServer = Optional.ofNullable(getProxy().getServerInfo(Config.MAINSERVER)); + if (!mainServer.isPresent()) + return; + Map map = new EnumMap<>(QueueType.class); - for (ProxiedPlayer player : mainServer.getPlayers()) { + for (ProxiedPlayer player : mainServer.get().getPlayers()) { QueueType playerType = QueueType.getQueueType(player::hasPermission); if (map.containsKey(playerType)) { diff --git a/src/main/java/net/pistonmaster/pistonqueue/velocity/PistonQueueVelocity.java b/src/main/java/net/pistonmaster/pistonqueue/velocity/PistonQueueVelocity.java index 847fea2..c656c2f 100644 --- a/src/main/java/net/pistonmaster/pistonqueue/velocity/PistonQueueVelocity.java +++ b/src/main/java/net/pistonmaster/pistonqueue/velocity/PistonQueueVelocity.java @@ -237,7 +237,7 @@ private void sendCustomData() { private void initializeReservationSlots() { proxyServer.getScheduler().buildTask(this, () -> { if (!proxyServer.getServer(Config.MAINSERVER).isPresent()) - throw new IllegalStateException("Main server not configured properly!!!"); + return; RegisteredServer mainServer = proxyServer.getServer(Config.MAINSERVER).get(); Map map = new EnumMap<>(QueueType.class);