From dbd3cfbef60ffb6fadfbf4ae42add274506571c9 Mon Sep 17 00:00:00 2001 From: MattBDev <4009945+MattBDev@users.noreply.github.com> Date: Wed, 1 Apr 2020 13:08:16 -0400 Subject: [PATCH] Add logging messages for CPU checking. --- .../com/boydti/fawe/object/task/AsyncNotifyQueue.java | 2 +- .../src/main/java/com/boydti/fawe/util/WEManager.java | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/task/AsyncNotifyQueue.java b/worldedit-core/src/main/java/com/boydti/fawe/object/task/AsyncNotifyQueue.java index e9400454b..f79906fb4 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/task/AsyncNotifyQueue.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/task/AsyncNotifyQueue.java @@ -36,8 +36,8 @@ public class AsyncNotifyQueue implements Closeable { Future[] self = new Future[1]; Callable wrapped = () -> { if (!closed) { + lock.lock(); try { - lock.lock(); if (!closed) { try { return task.call(); diff --git a/worldedit-core/src/main/java/com/boydti/fawe/util/WEManager.java b/worldedit-core/src/main/java/com/boydti/fawe/util/WEManager.java index a7b40ba44..64590f07b 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/util/WEManager.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/util/WEManager.java @@ -8,6 +8,7 @@ import com.boydti.fawe.regions.FaweMask; import com.boydti.fawe.regions.FaweMaskManager; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.Player; +import com.sk89q.worldedit.extension.platform.PlatformCommandManager; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.math.BlockVector3; @@ -19,14 +20,19 @@ import java.util.ArrayDeque; import java.util.HashSet; import java.util.Iterator; import java.util.Set; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class WEManager { + private static final Logger log = LoggerFactory.getLogger(WEManager.class); + public final static WEManager IMP = new WEManager(); public final ArrayDeque managers = new ArrayDeque<>(); public void cancelEditSafe(AbstractDelegateExtent parent, FaweException reason) throws FaweException { + log.warn("CancelEditSafe was hit. Please ignore this message."); try { final Field field = AbstractDelegateExtent.class.getDeclaredField("extent"); field.setAccessible(true); @@ -121,7 +127,9 @@ public class WEManager { player.printError(TextComponent.of("Missing permission " + "fawe." + manager.getKey())); } } + log.warn("There are " + backupRegions.size() + " backupRegions being added to Regions. Regions has " + regions.size() + " before backupRegions are added"); regions.addAll(backupRegions); + log.warn("Finished adding regions."); if (!masks.isEmpty()) { player.setMeta("lastMask", masks); } else {