diff --git a/src/main/java/world/bentobox/bentobox/api/flags/Flag.java b/src/main/java/world/bentobox/bentobox/api/flags/Flag.java index 4acca3cd1..938d0dc6b 100644 --- a/src/main/java/world/bentobox/bentobox/api/flags/Flag.java +++ b/src/main/java/world/bentobox/bentobox/api/flags/Flag.java @@ -384,6 +384,7 @@ public class Flag implements Comparable { */ @Nullable public PanelItem toPanelItem(BentoBox plugin, User user, World world, @Nullable Island island, boolean invisible) { + // TODO: Why is this taking long long m = System.currentTimeMillis(); // Invisibility if (!user.isOp() && invisible) { @@ -435,9 +436,11 @@ public class Flag implements Comparable { BentoBox.getInstance().logDebug("Protection flag"); if (island != null) { int y = island.getFlag(this); + BentoBox.getInstance().logDebug("Protection flag getFlag time " + (System.currentTimeMillis() - m)); // Protection flag pib.description(user.getTranslation("protection.panel.flag-item.description-layout", TextVariables.DESCRIPTION, user.getTranslation(getDescriptionReference()))); + BentoBox.getInstance().logDebug("Protection flag description time " + (System.currentTimeMillis() - m)); RanksManager.getInstance().getRanks().forEach((reference, score) -> { if (score > RanksManager.BANNED_RANK && score < y) { pib.description(user.getTranslation("protection.panel.flag-item.blocked-rank") + user.getTranslation(reference)); @@ -448,7 +451,7 @@ public class Flag implements Comparable { } }); } - BentoBox.getInstance().logDebug("Protection flag " + (System.currentTimeMillis() - m)); + BentoBox.getInstance().logDebug("Protection flag time " + (System.currentTimeMillis() - m)); return pib; } diff --git a/src/main/java/world/bentobox/bentobox/panels/settings/SettingsTab.java b/src/main/java/world/bentobox/bentobox/panels/settings/SettingsTab.java index 738c0c9ff..85486d6a1 100644 --- a/src/main/java/world/bentobox/bentobox/panels/settings/SettingsTab.java +++ b/src/main/java/world/bentobox/bentobox/panels/settings/SettingsTab.java @@ -123,16 +123,18 @@ public class SettingsTab implements Tab, ClickHandler { @Override @NonNull public List<@Nullable PanelItem> getPanelItems() { - long m = System.currentTimeMillis(); + BentoBox.getInstance().logDebug("Get panel items"); List flags = getFlags(); - BentoBox.getInstance().logDebug("Time for getFlags = " + (System.currentTimeMillis() - m)); int i = 0; // Jump past empty tabs while (flags.isEmpty() && i++ < Flag.Mode.values().length) { currentMode.put(user.getUniqueId(), currentMode.getOrDefault(user.getUniqueId(), Mode.BASIC).getNext()); flags = getFlags(); } + long m = System.currentTimeMillis(); + + // TODO This is taking too long!!! List<@Nullable PanelItem> result = new ArrayList<>(); for (Flag f : flags) {