Added hidden "enable-awe" option for AWE logging (default: false)

This commit is contained in:
Intelli 2022-03-02 16:24:56 -07:00
parent 2fa5af64ca
commit 7bc95931d2
2 changed files with 4 additions and 1 deletions

View File

@ -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);

View File

@ -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;