Simplified permissions by automatically allowing [cmd]air when cmd is allowed.

This commit is contained in:
sk89q 2010-10-18 16:19:22 -07:00
parent 5dc69ae325
commit 94876194c4
2 changed files with 3 additions and 1 deletions

View File

@ -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");
}
}

View File

@ -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");