From cff30a1db496df8140ebccf7d4b839974357702d Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sat, 18 Jun 2016 16:29:51 +1000 Subject: [PATCH] Fix scripting initialization --- .../com/intellectualcrafters/plot/PS.java | 30 ++++++++++--------- .../plot/commands/DebugExec.java | 4 ++- .../plot/commands/Merge.java | 2 -- .../intellectualcrafters/plot/config/C.java | 2 +- 4 files changed, 20 insertions(+), 18 deletions(-) diff --git a/Core/src/main/java/com/intellectualcrafters/plot/PS.java b/Core/src/main/java/com/intellectualcrafters/plot/PS.java index 3137c2a54..fb45d9ec6 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/PS.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/PS.java @@ -167,20 +167,6 @@ public class PS { if (Settings.Enabled_Components.KILL_ROAD_MOBS || Settings.Enabled_Components.KILL_ROAD_VEHICLES) { this.IMP.runEntityTask(); } - // WorldEdit - if (Settings.Enabled_Components.WORLDEDIT_RESTRICTIONS) { - try { - if (this.IMP.initWorldEdit()) { - PS.debug("PlotSquared hooked into WorldEdit."); - this.worldedit = WorldEdit.getInstance(); - WorldEdit.getInstance().getEventBus().register(new WESubscriber()); - new WE_Anywhere(); - - } - } catch (Throwable e) { - PS.debug("Incompatible version of WorldEdit, please upgrade: http://builds.enginehub.org/job/worldedit?branch=master"); - } - } if (Settings.Enabled_Components.EVENTS) { this.IMP.registerPlayerEvents(); this.IMP.registerInventoryEvents(); @@ -232,6 +218,22 @@ public class PS { if (Settings.Enabled_Components.COMMANDS) { this.IMP.registerCommands(); } + // WorldEdit + if (Settings.Enabled_Components.WORLDEDIT_RESTRICTIONS) { + try { + if (this.IMP.initWorldEdit()) { + PS.debug("PlotSquared hooked into WorldEdit."); + this.worldedit = WorldEdit.getInstance(); + WorldEdit.getInstance().getEventBus().register(new WESubscriber()); + if (Settings.Enabled_Components.COMMANDS) { + new WE_Anywhere(); + } + + } + } catch (Throwable e) { + PS.debug("Incompatible version of WorldEdit, please upgrade: http://builds.enginehub.org/job/worldedit?branch=master"); + } + } // Economy if (Settings.Enabled_Components.ECONOMY) { TaskManager.runTask(new Runnable() { diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/DebugExec.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/DebugExec.java index 9e58bc6f3..c5be5cb29 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/DebugExec.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/DebugExec.java @@ -78,7 +78,9 @@ public class DebugExec extends SubCommand { this.engine.eval(script, this.scope); } } - } catch (IOException | ScriptException ignored) {} + } catch (IOException | ScriptException ignored) { + ignored.printStackTrace(); + } } public ScriptEngine getEngine() { diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/Merge.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/Merge.java index 5eb61f42d..7bc1fec8e 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/Merge.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/Merge.java @@ -74,9 +74,7 @@ public class Merge extends SubCommand { final PlotArea plotArea = plot.getArea(); Expression priceExr = plotArea.PRICES.containsKey("merge") ? plotArea.PRICES.get("merge") : null; final int size = plot.getConnectedPlots().size(); - System.out.println("EXPRESSIONL " + priceExr); final double price = priceExr == null ? 0d : priceExr.evalute((double) size); - System.out.println("PRICE: " + price + " | " + EconHandler.manager + " | " + plotArea.USE_ECONOMY); if (EconHandler.manager != null && plotArea.USE_ECONOMY && price > 0d && EconHandler.manager.getMoney(player) < price) { sendMessage(player, C.CANNOT_AFFORD_MERGE, String.valueOf(price)); return false; diff --git a/Core/src/main/java/com/intellectualcrafters/plot/config/C.java b/Core/src/main/java/com/intellectualcrafters/plot/config/C.java index afde41add..1cd08afe4 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/config/C.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/config/C.java @@ -751,7 +751,7 @@ public enum C { // HashMap replacements = new HashMap<>(); replacements.clear(); for (String style : styles) { - replacements.put('$' + style, 'ยง' + config.getString(style)); + replacements.put('$' + style, '\u00A7' + config.getString(style)); } for (char letter : "1234567890abcdefklmnor".toCharArray()) { replacements.put("&" + letter, "\u00a7" + letter);