Using getDescription().getCommands() to set same executor for all commands of the plugin

Discussion in 'Plugin Development' started by iffa, Nov 22, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    iffa

    So I have no idea how to use getCommands(), and I'd like to use it to set the same executor for every command of the plugin. How?
     
  2. Offline

    halley

    The PluginDescriptionFile object just lists the return type of getCommands() as an Object. This is likely to relying on some other parser (like YML) to return a suitable data structure.

    Start doing some tests yourself, print out the returned object.getClass().toString() to your logs, but I expect you'll find it to be an ad-hoc tree of instances of type HashMap<String,Object>. Each value would be another hashmap or arraylist, all the way down.
     
  3. Offline

    Sagacious_Zed Bukkit Docs

    It returns an Object, because what can be returned is either a string or another hashmap, in the event you have a nested structures.
     
  4. Offline

    iffa

    So if each command of my plugin has only a description, how would I set the executor for all of them? I'm pretty bad with stuff with bad documentation.
     
Thread Status:
Not open for further replies.

Share This Page