From 94876194c40157f0eb08e195aa09e4110cae0206 Mon Sep 17 00:00:00 2001 From: sk89q Date: Mon, 18 Oct 2010 16:19:22 -0700 Subject: [PATCH] Simplified permissions by automatically allowing [cmd]air when cmd is allowed. --- src/SMWorldEditListener.java | 2 +- src/WorldEdit.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/SMWorldEditListener.java b/src/SMWorldEditListener.java index 9a7b1f4d3..2f63250d5 100644 --- a/src/SMWorldEditListener.java +++ b/src/SMWorldEditListener.java @@ -190,7 +190,7 @@ public class SMWorldEditListener extends PluginListener { * @return */ private boolean canUseCommand(Player player, String command) { - return player.canUseCommand(command) + return player.canUseCommand(command.replace("air", "")) || player.canUseCommand("/worldedit"); } } \ No newline at end of file diff --git a/src/WorldEdit.java b/src/WorldEdit.java index 5857edc7f..62c52b393 100644 --- a/src/WorldEdit.java +++ b/src/WorldEdit.java @@ -110,6 +110,8 @@ public class WorldEdit { * Construct an instance of the plugin. */ private WorldEdit() { + // Note: Commands should only have the phrase 'air' at the end + // for now (see SMWorldEditListener.canUseCommand) commands.put("//pos1", "Set editing position #1"); commands.put("//pos2", "Set editing position #2"); commands.put("/toggleplace", "Toggle placing at pos #1");