From 47fb0e137a4ed0195e630792da91d2ae15b6482d Mon Sep 17 00:00:00 2001 From: Jascha Starke Date: Sat, 4 Jan 2014 21:03:31 +0100 Subject: [PATCH] Quick-Hack: Disable WorldEdit-Integration for Performance-Reason --- .../minecraft/limitedcreative/ModBlockStates.java | 2 +- .../blockstate/BlockStateConfig.java | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/ModBlockStates.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/ModBlockStates.java index 94d25c1..62f86bd 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/ModBlockStates.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/ModBlockStates.java @@ -73,7 +73,7 @@ public class ModBlockStates extends CoreModule { return; } super.onEnable(); - if (plugin.getServer().getPluginManager().isPluginEnabled("WorldEdit")) { + if (plugin.getServer().getPluginManager().isPluginEnabled("WorldEdit") && config.getWorldeditIntegration()) { new BukkitRunnable() { @Override public void run() { diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/blockstate/BlockStateConfig.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/blockstate/BlockStateConfig.java index 0098357..ac6f059 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/blockstate/BlockStateConfig.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/blockstate/BlockStateConfig.java @@ -158,6 +158,20 @@ public class BlockStateConfig extends Configuration implements IConfigurationSub return ignoredWorlds; } + /** + * BlockStateWorldEditIntegration + * + * Allows you to disable hook into WorldEdit for better Performance. By default Integration is enable, so it logs + * block modifications via worldedit as creative-placed blocks in the database. + * A server reload (better restart) is needed to disabled WE-Integration. + * + * default: true + */ + @IsConfigurationNode(order = 600) + public boolean getWorldeditIntegration() { + return config.getBoolean("worldeditIntegration", true); + } + protected void setTool(Object val) throws InvalidValueException { String v = (String) val; Material m = null;