From 7e7fc89e8156a426af2144004f781cbde83f85d2 Mon Sep 17 00:00:00 2001 From: MattBDev <4009945+MattBDev@users.noreply.github.com> Date: Thu, 13 Feb 2020 18:15:45 -0500 Subject: [PATCH] Added debug messages to diagnose a critical CPU usage issue --- .../com/boydti/fawe/beta/IBatchProcessor.java | 2 ++ .../worldedit/extension/platform/Actor.java | 23 ++++++++++--------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/worldedit-core/src/main/java/com/boydti/fawe/beta/IBatchProcessor.java b/worldedit-core/src/main/java/com/boydti/fawe/beta/IBatchProcessor.java index 7f913b5d1..25d478f43 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/beta/IBatchProcessor.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/beta/IBatchProcessor.java @@ -70,12 +70,14 @@ public interface IBatchProcessor { } try { int layer = (minY - 15) >> 4; + Fawe.imp().debug("layer: " + layer + " < " +((maxY + 15) >> 4)); while (layer < (maxY + 15) >> 4) { if (layer > -1) { if (set.hasSection(layer)) { return true; } layer++; + Fawe.imp().debug("layer++ : " + layer); } } } catch (ArrayIndexOutOfBoundsException exception) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Actor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Actor.java index 78c2b1b9a..244832e23 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Actor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Actor.java @@ -35,6 +35,7 @@ import com.sk89q.worldedit.session.request.Request; import com.sk89q.worldedit.util.Identifiable; import com.sk89q.worldedit.util.auth.Subject; import com.sk89q.worldedit.util.formatting.text.Component; +import com.sk89q.worldedit.util.formatting.text.format.TextColor; import java.io.File; import java.io.IOException; @@ -110,7 +111,7 @@ public interface Actor extends Identifiable, SessionOwner, Subject, MapMetadatab * @param component The component to print */ default void printError(Component component) { - print(TranslatableComponent.of("fawe.error", component)); + print(component.color(TextColor.RED)); } /** @@ -119,7 +120,16 @@ public interface Actor extends Identifiable, SessionOwner, Subject, MapMetadatab * @param component The component to print */ default void printInfo(Component component) { - print(TranslatableComponent.of("fawe.info", component)); + print(component.color(TextColor.LIGHT_PURPLE)); + } + + /** + * Print a WorldEdit message. + * + * @param component The component to print + */ + default void printDebug(Component component) { + print(component.color(TextColor.GRAY)); } /** @@ -136,15 +146,6 @@ public interface Actor extends Identifiable, SessionOwner, Subject, MapMetadatab */ boolean canDestroyBedrock(); - /** - * Print a WorldEdit message. - * - * @param component The component to print - */ - default void printDebug(Component component) { - print(TranslatableComponent.of("fawe.debug", component)); - } - /** * Return whether this actor is a player. *