Added an actually logical overload
This commit is contained in:
parent
7131021a86
commit
90dd6d190e
1 changed files with 26 additions and 0 deletions
|
@ -105,6 +105,32 @@ public class TBMCChatAPI {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* This method adds a plugin's command to help and sets it's executor.
|
||||||
|
* </p>
|
||||||
|
* <p>
|
||||||
|
* The <u>command must be registered</u> in the caller plugin's plugin.yml. Otherwise the plugin will output a messsage to console.
|
||||||
|
* </p>
|
||||||
|
* <p>
|
||||||
|
* <i>Using this method after the server is done loading will have no effect.</i>
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @param plugin
|
||||||
|
* The caller plugin
|
||||||
|
* @param cmd
|
||||||
|
* The command to add
|
||||||
|
*/
|
||||||
|
public static void AddCommand(JavaPlugin plugin, TBMCCommandBase cmd) {
|
||||||
|
plugin.getLogger().info("Registering command " + cmd.GetCommandPath() + " for " + plugin.getName());
|
||||||
|
try {
|
||||||
|
cmd.plugin = plugin;
|
||||||
|
commands.put(cmd.GetCommandPath(), cmd);
|
||||||
|
} catch (Exception e) {
|
||||||
|
TBMCCoreAPI.SendException("An error occured while registering command " + cmd.GetCommandPath(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* Add player information for {@link PlayerInfoCommand}. Only mods can see the given information.
|
* Add player information for {@link PlayerInfoCommand}. Only mods can see the given information.
|
||||||
|
|
Loading…
Reference in a new issue