mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-23 01:27:40 +01:00
Remove pointless iterable.
This commit is contained in:
parent
87162acf11
commit
c413cf4123
@ -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<BukkitWorldConfiguration> getWorldConfigs() {
|
||||
public Collection<BukkitWorldConfiguration> getWorldConfigs() {
|
||||
return worlds.values();
|
||||
}
|
||||
|
||||
|
@ -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<String, Integer> 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())));
|
||||
|
Loading…
Reference in New Issue
Block a user