From 15977e85a53258e12aee1931df2cd53e3829723f Mon Sep 17 00:00:00 2001 From: zml2008 Date: Sat, 28 Apr 2012 10:30:03 -0700 Subject: [PATCH] Add a -f flag to //schem l to make it ignore format checks --- src/main/java/com/sk89q/bukkit/util/DynamicPluginCommand.java | 2 +- .../java/com/sk89q/worldedit/commands/SchematicCommands.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/sk89q/bukkit/util/DynamicPluginCommand.java b/src/main/java/com/sk89q/bukkit/util/DynamicPluginCommand.java index 7140302fe..79cb76b6c 100644 --- a/src/main/java/com/sk89q/bukkit/util/DynamicPluginCommand.java +++ b/src/main/java/com/sk89q/bukkit/util/DynamicPluginCommand.java @@ -85,7 +85,7 @@ public class DynamicPluginCommand extends org.bukkit.command.Command implements if (registeredWith instanceof CommandsManager) { try { for (String permission : permissions) { - if (((CommandsManager) registeredWith).hasPermission(sender, permission)) { + if (((CommandsManager) registeredWith).hasPermission(sender, permission)) { return true; } } diff --git a/src/main/java/com/sk89q/worldedit/commands/SchematicCommands.java b/src/main/java/com/sk89q/worldedit/commands/SchematicCommands.java index aabdab2a0..1cbd658ce 100644 --- a/src/main/java/com/sk89q/worldedit/commands/SchematicCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/SchematicCommands.java @@ -55,6 +55,7 @@ public class SchematicCommands { "Format is a format from \"//schematic formats\"\n" + "If the format is not provided, WorldEdit will\n" + "attempt to automatically detect the format of the schematic", + flags = "f", min = 1, max = 2 ) @@ -86,7 +87,7 @@ public class SchematicCommands { return; } - if (!format.isOfFormat(f)) { + if (!format.isOfFormat(f) && !args.hasFlag('f')) { player.printError(fileName + " is not of the " + format.getName() + " schematic format!"); return; }