From 7bc95931d23c1b8f8dc6ba1349c5d859bd1783da Mon Sep 17 00:00:00 2001 From: Intelli Date: Wed, 2 Mar 2022 16:24:56 -0700 Subject: [PATCH] Added hidden "enable-awe" option for AWE logging (default: false) --- src/main/java/net/coreprotect/config/Config.java | 2 ++ .../net/coreprotect/worldedit/CoreProtectEditSessionEvent.java | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/coreprotect/config/Config.java b/src/main/java/net/coreprotect/config/Config.java index bf481e3..4d7ee68 100644 --- a/src/main/java/net/coreprotect/config/Config.java +++ b/src/main/java/net/coreprotect/config/Config.java @@ -41,6 +41,7 @@ public class Config extends Language { public String MYSQL_USERNAME; public String MYSQL_PASSWORD; public String LANGUAGE; + public boolean ENABLE_AWE; public boolean HOVER_EVENTS; public boolean DATABASE_LOCK; public boolean LOG_CANCELLED_CHAT; @@ -179,6 +180,7 @@ public class Config extends Language { } private void readValues() { + this.ENABLE_AWE = this.getBoolean("enable-awe", false); this.HOVER_EVENTS = this.getBoolean("hover-events", true); this.DATABASE_LOCK = this.getBoolean("database-lock", true); this.LOG_CANCELLED_CHAT = this.getBoolean("log-cancelled-chat", true); diff --git a/src/main/java/net/coreprotect/worldedit/CoreProtectEditSessionEvent.java b/src/main/java/net/coreprotect/worldedit/CoreProtectEditSessionEvent.java index 1f4305e..02ec00f 100755 --- a/src/main/java/net/coreprotect/worldedit/CoreProtectEditSessionEvent.java +++ b/src/main/java/net/coreprotect/worldedit/CoreProtectEditSessionEvent.java @@ -10,6 +10,7 @@ import com.sk89q.worldedit.util.eventbus.Subscribe; import com.sk89q.worldedit.world.World; import net.coreprotect.CoreProtect; +import net.coreprotect.config.Config; import net.coreprotect.config.ConfigHandler; import net.coreprotect.language.Phrase; import net.coreprotect.language.Selector; @@ -31,7 +32,7 @@ public class CoreProtectEditSessionEvent { } try { - if (Bukkit.getServer().getPluginManager().getPlugin("AsyncWorldEdit") == null) { + if (Bukkit.getServer().getPluginManager().getPlugin("AsyncWorldEdit") == null || Config.getGlobal().ENABLE_AWE) { WorldEdit.getInstance().getEventBus().register(event); initialized = true; ConfigHandler.worldeditEnabled = true;