From 80d4d9165f143b1b92c60cfa4991d2bbfe8acde4 Mon Sep 17 00:00:00 2001 From: SirBlobman Date: Tue, 15 Oct 2019 18:20:18 +0000 Subject: [PATCH] Fix console errors when generator is disabled --- src/main/java/com/songoda/skyblock/listeners/Block.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/songoda/skyblock/listeners/Block.java b/src/main/java/com/songoda/skyblock/listeners/Block.java index 0b19c20f..52363392 100644 --- a/src/main/java/com/songoda/skyblock/listeners/Block.java +++ b/src/main/java/com/songoda/skyblock/listeners/Block.java @@ -506,9 +506,10 @@ public class Block implements Listener { return; GeneratorManager generatorManager = skyblock.getGeneratorManager(); + if(generatorManager == null) return; + List generators = Lists.newArrayList(generatorManager.getGenerators()); - if (generatorManager == null || generators.size() == 0) - return; + if(generators == null || generators.isEmpty()) return; Collections.reverse(generators); // Use the highest generator available // Filter valid players on the island.