From cd16ca3abba8552cb9ebf7c5f16f69829e629f79 Mon Sep 17 00:00:00 2001 From: sk89q Date: Sat, 6 Nov 2010 01:32:36 -0700 Subject: [PATCH] Added register-help configuration to disable registering WorldEdit's commands with hMod's help system. --- src/WorldEditListener.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/WorldEditListener.java b/src/WorldEditListener.java index b2ea58c38..7ddf324de 100644 --- a/src/WorldEditListener.java +++ b/src/WorldEditListener.java @@ -101,6 +101,10 @@ public class WorldEditListener extends PluginListener { * Indicates whether commands should be logged to the console. */ private boolean logComands = false; + /** + * True to register the commands with the help system. + */ + private boolean registerHelp = true; /** * Construct an instance of the plugin. @@ -1451,6 +1455,8 @@ public class WorldEditListener extends PluginListener { String type = properties.getString("shell-save-type", "").trim(); shellSaveType = type.equals("") ? null : type; + registerHelp = properties.getBoolean("register-help", true); + logComands = properties.getBoolean("log-commands", false); String logFile = properties.getString("log-file", ""); @@ -1483,8 +1489,10 @@ public class WorldEditListener extends PluginListener { * Register commands with help. */ public void registerCommands() { - for (Map.Entry entry : commands.entrySet()) { - etc.getInstance().addCommand(entry.getKey(), entry.getValue()); + if (registerHelp) { + for (Map.Entry entry : commands.entrySet()) { + etc.getInstance().addCommand(entry.getKey(), entry.getValue()); + } } }