Debug debug
This commit is contained in:
parent
fd12ef9fe7
commit
5b4ecd5293
|
@ -384,6 +384,7 @@ public class Flag implements Comparable<Flag> {
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
public PanelItem toPanelItem(BentoBox plugin, User user, World world, @Nullable Island island, boolean invisible) {
|
public PanelItem toPanelItem(BentoBox plugin, User user, World world, @Nullable Island island, boolean invisible) {
|
||||||
|
// TODO: Why is this taking long
|
||||||
long m = System.currentTimeMillis();
|
long m = System.currentTimeMillis();
|
||||||
// Invisibility
|
// Invisibility
|
||||||
if (!user.isOp() && invisible) {
|
if (!user.isOp() && invisible) {
|
||||||
|
@ -435,9 +436,11 @@ public class Flag implements Comparable<Flag> {
|
||||||
BentoBox.getInstance().logDebug("Protection flag");
|
BentoBox.getInstance().logDebug("Protection flag");
|
||||||
if (island != null) {
|
if (island != null) {
|
||||||
int y = island.getFlag(this);
|
int y = island.getFlag(this);
|
||||||
|
BentoBox.getInstance().logDebug("Protection flag getFlag time " + (System.currentTimeMillis() - m));
|
||||||
// Protection flag
|
// Protection flag
|
||||||
pib.description(user.getTranslation("protection.panel.flag-item.description-layout",
|
pib.description(user.getTranslation("protection.panel.flag-item.description-layout",
|
||||||
TextVariables.DESCRIPTION, user.getTranslation(getDescriptionReference())));
|
TextVariables.DESCRIPTION, user.getTranslation(getDescriptionReference())));
|
||||||
|
BentoBox.getInstance().logDebug("Protection flag description time " + (System.currentTimeMillis() - m));
|
||||||
RanksManager.getInstance().getRanks().forEach((reference, score) -> {
|
RanksManager.getInstance().getRanks().forEach((reference, score) -> {
|
||||||
if (score > RanksManager.BANNED_RANK && score < y) {
|
if (score > RanksManager.BANNED_RANK && score < y) {
|
||||||
pib.description(user.getTranslation("protection.panel.flag-item.blocked-rank") + user.getTranslation(reference));
|
pib.description(user.getTranslation("protection.panel.flag-item.blocked-rank") + user.getTranslation(reference));
|
||||||
|
@ -448,7 +451,7 @@ public class Flag implements Comparable<Flag> {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
BentoBox.getInstance().logDebug("Protection flag " + (System.currentTimeMillis() - m));
|
BentoBox.getInstance().logDebug("Protection flag time " + (System.currentTimeMillis() - m));
|
||||||
return pib;
|
return pib;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -123,16 +123,18 @@ public class SettingsTab implements Tab, ClickHandler {
|
||||||
@Override
|
@Override
|
||||||
@NonNull
|
@NonNull
|
||||||
public List<@Nullable PanelItem> getPanelItems() {
|
public List<@Nullable PanelItem> getPanelItems() {
|
||||||
long m = System.currentTimeMillis();
|
|
||||||
BentoBox.getInstance().logDebug("Get panel items");
|
BentoBox.getInstance().logDebug("Get panel items");
|
||||||
List<Flag> flags = getFlags();
|
List<Flag> flags = getFlags();
|
||||||
BentoBox.getInstance().logDebug("Time for getFlags = " + (System.currentTimeMillis() - m));
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
// Jump past empty tabs
|
// Jump past empty tabs
|
||||||
while (flags.isEmpty() && i++ < Flag.Mode.values().length) {
|
while (flags.isEmpty() && i++ < Flag.Mode.values().length) {
|
||||||
currentMode.put(user.getUniqueId(), currentMode.getOrDefault(user.getUniqueId(), Mode.BASIC).getNext());
|
currentMode.put(user.getUniqueId(), currentMode.getOrDefault(user.getUniqueId(), Mode.BASIC).getNext());
|
||||||
flags = getFlags();
|
flags = getFlags();
|
||||||
}
|
}
|
||||||
|
long m = System.currentTimeMillis();
|
||||||
|
|
||||||
|
// TODO This is taking too long!!!
|
||||||
|
|
||||||
List<@Nullable PanelItem> result = new ArrayList<>();
|
List<@Nullable PanelItem> result = new ArrayList<>();
|
||||||
for (Flag f : flags) {
|
for (Flag f : flags) {
|
||||||
|
|
Loading…
Reference in New Issue