diff --git a/worldguard-bukkit/src/main/java/com/sk89q/worldguard/bukkit/BukkitConfigurationManager.java b/worldguard-bukkit/src/main/java/com/sk89q/worldguard/bukkit/BukkitConfigurationManager.java index 9f54750b..a48182c1 100644 --- a/worldguard-bukkit/src/main/java/com/sk89q/worldguard/bukkit/BukkitConfigurationManager.java +++ b/worldguard-bukkit/src/main/java/com/sk89q/worldguard/bukkit/BukkitConfigurationManager.java @@ -26,6 +26,7 @@ import com.sk89q.worldedit.util.report.Unreported; import java.io.File; +import java.util.Collection; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; @@ -47,7 +48,7 @@ public BukkitConfigurationManager(WorldGuardPlugin plugin) { this.plugin = plugin; } - public Iterable getWorldConfigs() { + public Collection getWorldConfigs() { return worlds.values(); } diff --git a/worldguard-bukkit/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlugin.java b/worldguard-bukkit/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlugin.java index 4c292689..9f0de6ea 100644 --- a/worldguard-bukkit/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlugin.java +++ b/worldguard-bukkit/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlugin.java @@ -232,12 +232,12 @@ private void setupCustomCharts(Metrics metrics) { int whitelisted = 0; for (BukkitWorldConfiguration worldConfig : platform.getGlobalStateManager().getWorldConfigs()) { Blacklist blacklist = worldConfig.getBlacklist(); - if (blacklist == null || blacklist.isEmpty()) { - continue; - } else if (blacklist.isWhitelist()) { - whitelisted += blacklist.getItemCount(); - } else { - blacklisted += blacklist.getItemCount(); + if (blacklist != null && !blacklist.isEmpty()) { + if (blacklist.isWhitelist()) { + whitelisted += blacklist.getItemCount(); + } else { + blacklisted += blacklist.getItemCount(); + } } } Map blacklistCounts = new HashMap<>(); @@ -246,9 +246,9 @@ private void setupCustomCharts(Metrics metrics) { return blacklistCounts; })); metrics.addCustomChart(new Metrics.SimplePie("chest_protection", () -> - "" + Streams.stream(platform.getGlobalStateManager().getWorldConfigs()).anyMatch(cfg -> cfg.signChestProtection))); + "" + platform.getGlobalStateManager().getWorldConfigs().stream().anyMatch(cfg -> cfg.signChestProtection))); metrics.addCustomChart(new Metrics.SimplePie("build_permissions", () -> - "" + Streams.stream(platform.getGlobalStateManager().getWorldConfigs()).anyMatch(cfg -> cfg.buildPermissions))); + "" + platform.getGlobalStateManager().getWorldConfigs().stream().anyMatch(cfg -> cfg.buildPermissions))); metrics.addCustomChart(new Metrics.SimplePie("custom_flags", () -> "" + (WorldGuard.getInstance().getFlagRegistry().size() > Flags.INBUILT_FLAGS.size())));