diff --git a/core/src/main/java/com/boydti/fawe/object/FawePlayer.java b/core/src/main/java/com/boydti/fawe/object/FawePlayer.java index 27b77074..4aa9eb22 100644 --- a/core/src/main/java/com/boydti/fawe/object/FawePlayer.java +++ b/core/src/main/java/com/boydti/fawe/object/FawePlayer.java @@ -134,7 +134,7 @@ public abstract class FawePlayer extends Metadatable { } public void checkConfirmationRadius(String command, int radius) throws RegionOperationException { - if (getMeta("cmdConfirmRunning", false)) { + if (command == null || getMeta("cmdConfirmRunning", false)) { return; } if (radius > 0) { @@ -146,7 +146,7 @@ public abstract class FawePlayer extends Metadatable { } public void checkConfirmationStack(String command, Region region, int times) throws RegionOperationException { - if (getMeta("cmdConfirmRunning", false)) { + if (command == null || getMeta("cmdConfirmRunning", false)) { return; } if (region != null) { @@ -161,7 +161,7 @@ public abstract class FawePlayer extends Metadatable { } public void checkConfirmationRegion(String command, Region region) throws RegionOperationException { - if (getMeta("cmdConfirmRunning", false)) { + if (command == null || getMeta("cmdConfirmRunning", false)) { return; } if (region != null) { diff --git a/core/src/main/java/com/sk89q/worldedit/command/MethodCommands.java b/core/src/main/java/com/sk89q/worldedit/command/MethodCommands.java index 423e3814..389c2ec2 100644 --- a/core/src/main/java/com/sk89q/worldedit/command/MethodCommands.java +++ b/core/src/main/java/com/sk89q/worldedit/command/MethodCommands.java @@ -72,6 +72,7 @@ public class MethodCommands { } public String getArguments(CommandContext context) { + if (context == null) return null; CommandLocals locals = context.getLocals(); if (locals != null) { return (String) locals.get("arguments"); diff --git a/core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java b/core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java index f4d62d57..0fd0b090 100644 --- a/core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java +++ b/core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java @@ -322,6 +322,12 @@ public class RegionCommands extends MethodCommands { BBC.TIP_REPLACE_ID.or(BBC.TIP_REPLACE_LIGHT, BBC.TIP_REPLACE_MARKER, BBC.TIP_TAB_COMPLETE).send(player); } + // Compatibility for SKCompat + @Deprecated + public void set(Player player, LocalSession session, EditSession editSession, Pattern pattern) throws WorldEditException { + set(FawePlayer.wrap(player), session, editSession, session.getSelection(player.getWorld()), pattern, null); + } + @Command( aliases = {"/set", "/s"}, usage = "[pattern]", diff --git a/core/src/main/java/com/sk89q/worldedit/command/ScriptingCommands.java b/core/src/main/java/com/sk89q/worldedit/command/ScriptingCommands.java index 117199bb..6183bfbd 100644 --- a/core/src/main/java/com/sk89q/worldedit/command/ScriptingCommands.java +++ b/core/src/main/java/com/sk89q/worldedit/command/ScriptingCommands.java @@ -69,7 +69,7 @@ public class ScriptingCommands { final File dir = this.worldEdit.getWorkingDirectoryFile(this.worldEdit.getConfiguration().scriptsDir); final File f = this.worldEdit.getSafeOpenFile(player, dir, name, "js", "js"); try { - ScriptingCommands.this.worldEdit.runScript(LocationMaskedPlayerWrapper.unwrap(player), f, scriptArgs); + this.worldEdit.runScript(LocationMaskedPlayerWrapper.unwrap(player), f, scriptArgs); } catch (final WorldEditException ex) { player.printError("Error while executing CraftScript."); } @@ -97,7 +97,7 @@ public class ScriptingCommands { final File f = this.worldEdit.getSafeOpenFile(player, dir, lastScript, "js", "js"); try { - ScriptingCommands.this.worldEdit.runScript(LocationMaskedPlayerWrapper.unwrap(player), f, scriptArgs); + this.worldEdit.runScript(LocationMaskedPlayerWrapper.unwrap(player), f, scriptArgs); } catch (final WorldEditException ex) { player.printError("Error while executing CraftScript."); }