From 35b1202951bcfb4e45938c227403bf6f590d4e52 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Sun, 4 Jul 2021 00:43:57 +0200 Subject: [PATCH] Mitigate logger spam introduced in https://github.com/IntellectualSites/FastAsyncWorldEdit/commit/256d7c4e5df488916877718e0df2057628eb4108 Touches #1122, #1166 --- .../com/fastasyncworldedit/core/configuration/Settings.java | 3 +++ .../worldedit/extent/transform/BlockTransformExtent.java | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/configuration/Settings.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/configuration/Settings.java index 7d9148465..c80590db2 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/configuration/Settings.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/configuration/Settings.java @@ -79,6 +79,9 @@ public class Settings extends Config { "Only disables/enables the hook with v4. For v6, see PlotSquared settings.yml" }) public boolean PLOTSQUARED_v4_HOOK = true; + @Comment({"Show additional information in console. It helps us at IntellectualSites to find out more about an issue.", + "Leave it off if you don't need it, it can spam your console."}) + public boolean DEBUG = false; } @Comment("Paths for various directories") diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/transform/BlockTransformExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/transform/BlockTransformExtent.java index 42d6a6136..74e0db1a9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/transform/BlockTransformExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/transform/BlockTransformExtent.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.extent.transform; +import com.fastasyncworldedit.core.configuration.Settings; import com.fastasyncworldedit.core.object.extent.ResettableExtent; import com.google.common.collect.ImmutableMap; import com.sk89q.jnbt.ByteTag; @@ -402,7 +403,9 @@ public class BlockTransformExtent extends ResettableExtent { if (directions != null) { int oldIndex = property.getIndex(newMaskedId); if (oldIndex >= directions.length) { - LOGGER.warn(String.format("Index outside direction array length found for block:{%s} property:{%s}", state.getBlockType().getId(), property.getName())); + if (Settings.IMP.ENABLED_COMPONENTS.DEBUG) { + LOGGER.warn(String.format("Index outside direction array length found for block:{%s} property:{%s}", state.getBlockType().getId(), property.getName())); + } continue; } Integer newIndex = getNewStateIndex(transform, directions, oldIndex);