From 07c02b5825fd8b0d1b94295547f33fd1c65adaf5 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Thu, 23 Sep 2021 12:34:22 +0100 Subject: [PATCH] Remove import static org.apache.logging.log4j.LogManager.getLogger --- .../core/history/changeset/AbstractChangeSet.java | 8 +++++--- .../fastasyncworldedit/core/queue/IBatchProcessor.java | 5 ++--- .../sk89q/worldedit/extent/AbstractDelegateExtent.java | 3 +-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/history/changeset/AbstractChangeSet.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/history/changeset/AbstractChangeSet.java index a9ad01657..04b1b5c76 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/history/changeset/AbstractChangeSet.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/history/changeset/AbstractChangeSet.java @@ -24,12 +24,14 @@ import com.sk89q.worldedit.history.change.Change; import com.sk89q.worldedit.history.change.EntityCreate; import com.sk89q.worldedit.history.change.EntityRemove; import com.sk89q.worldedit.history.changeset.ChangeSet; +import com.sk89q.worldedit.internal.util.LogManagerCompat; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockState; +import org.apache.logging.log4j.Logger; import java.io.IOException; import java.util.Iterator; @@ -40,10 +42,10 @@ import java.util.UUID; import java.util.concurrent.Future; import java.util.concurrent.atomic.AtomicInteger; -import static org.apache.logging.log4j.LogManager.getLogger; - public abstract class AbstractChangeSet implements ChangeSet, IBatchProcessor { + private static final Logger LOGGER = LogManagerCompat.getLogger(); + private final World world; protected AtomicInteger waitingCombined = new AtomicInteger(0); protected AtomicInteger waitingAsync = new AtomicInteger(0); @@ -285,7 +287,7 @@ public abstract class AbstractChangeSet implements ChangeSet, IBatchProcessor { } else if (change.getClass() == EntityRemove.class) { add((EntityRemove) change); } else { - getLogger(AbstractChangeSet.class).debug("Unknown change: " + change.getClass()); + LOGGER.debug("Unknown change: " + change.getClass()); } } diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/IBatchProcessor.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/IBatchProcessor.java index 6770c706c..fdd4eddf9 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/IBatchProcessor.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/queue/IBatchProcessor.java @@ -4,6 +4,7 @@ import com.fastasyncworldedit.core.extent.processor.EmptyBatchProcessor; import com.fastasyncworldedit.core.extent.processor.MultiBatchProcessor; import com.fastasyncworldedit.core.extent.processor.ProcessorScope; import com.sk89q.jnbt.CompoundTag; +import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.math.BlockVector3; @@ -13,8 +14,6 @@ import java.util.Set; import java.util.concurrent.Future; import java.util.function.Function; -import static org.apache.logging.log4j.LogManager.getLogger; - public interface IBatchProcessor { /** @@ -87,7 +86,7 @@ public interface IBatchProcessor { layer++; } } catch (ArrayIndexOutOfBoundsException exception) { - getLogger(IBatchProcessor.class).error("minY = {} , layer = {}", minY, ((minY - 15) >> 4), exception); + WorldEdit.logger.error("minY = {} , layer = {}", minY, ((minY - 15) >> 4), exception); } return false; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java index 170966fa5..820a4f34a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/AbstractDelegateExtent.java @@ -49,7 +49,6 @@ import java.util.List; import java.util.UUID; import static com.google.common.base.Preconditions.checkNotNull; -import static org.apache.logging.log4j.LogManager.getLogger; /** * A base class for {@link Extent}s that merely passes extents onto another. @@ -214,7 +213,7 @@ public class AbstractDelegateExtent implements Extent { Extent next = ((AbstractDelegateExtent) extent).getExtent(); new ExtentTraverser(this).setNext(next); } else { - getLogger(AbstractDelegateExtent.class).debug("Cannot disable queue"); + LOGGER.debug("Cannot disable queue"); } }