[INACTIVE][INFO] Help 0.2: The smart /help menu [531]

Discussion in 'Inactive/Unsupported Plugins' started by tkelly, Feb 28, 2011.

  1. Offline

    tkelly

    Help v0.2
    Download Help v0.2
    Download Help (Static Jar)
    Help Source Code
    Suggest Features

    Help has support for both GroupManager and Permissions, so you can use either one. You can also use neither if you so choose. Help will not force you to any which one.

    What is Help?
    Help is a clean and advanced /help menu. Help separates "main" commands from secondary ones, allowing you to have a clean initial menu, but still able to dig down and get access to every possible command.

    It is also the first /help menu to take into account permissions; some commands simply aren't applicable to all users, so those commands should clearly not be visible to those users. Now, default users' help menus won't be cluttered with commands for admin tools they have no way of using.

    Scroll down for a preview, or see below for how to hook into Help :)

    Help Commands
    /help (#) : Shows the /help menu.
    /help http://dev.bukkit.org/bukkit-plugins/ (#)[/I][/B]:[/FONT] Shows all the help entries for [I][plugin][/I]. [B][FONT=courier new]/help plugins[/FONT][/B] : Shows a list of all the plugins with Help entries. [FONT=courier new][B]/help search [I][query][/I][/B][/FONT] : Searches for [I][query][/I] within it' entries. [B][FONT=courier new]/help reload[/FONT][/B] : Reloads the entries from ExtraHelp.yml. [FONT=helvetica][SIZE=5][B]Plugin Support[/B][/SIZE][/FONT] Help requires that plugins tell Help about the commands they use. This makes sure that the commands and permissions are accurate and precise (rather than trying to auto fetch commands). Because it's ridiculous to assume that all plugins will instantly jump up and support Help (we can dream can't we? :D), server admins can mimic this behavior by supplying... [SIZE=5][FONT=helvetica][B]Custom ExtraHelp/[/B][/FONT][/SIZE] In the Help.zip download, I include a Help/ folder with a sample extra helps inside the ExtraHelp folder. This shows you how you can add custom commands to the /help menu. I'll also cover how to do that here. Each command has a "name", this name is only for you, as Help doesn't care about it (they just need to be unique names). In the following example the names are 'versions', 'pluginversions', 'kick' and 'essentialswho'. Within these Nodes you [U][I][B]need[/B][/I][/U] 3 things: command, description, and plugin. These should be self-explanatory. The two optional pieces are "main" and "permissions". If you specify a "main", you can choose whether or not the command is important enough to show up on the main /help menu; if you leave it blank or skip it, it will default to 'false'. If you specify a "visible", you can specify whether the command shows up at all. This is useful for overriding other plugins' built-in Help support (in case you don't want all the commands); if you leave it blank or skip it, it will default to 'true'. If you specify a "permissions", you can choose what is necessary for the user to see the command; and leaving it blank will allow all to see. So in the case of /version, all users can use it, so no permissions. But with /who, you have to have essentials.list, so that was specified. There is also a special permission case, "OP". By specifying this, this will require the user to be an OP to use the command (as is the case with Minecraft's built-in /kick command). [CODE] versions: command: version description: Show the version of Minecraft and CB plugin: CraftBukkit main: true pluginversions: command: version [plugin] description: Shows the version of [plugin] plugin: CraftBukkit kick: command: kick [player] description: Kicks [player] from the server plugin: Minecraft main: true permissions: OP essentialswho: command: who description: Show who's one the server plugin: Essentials main: true permissions: essentials.list [/CODE] [B][SIZE=5][FONT=helvetica]How To Hook into Help.[/FONT][/SIZE][/B] Hooking into Help is extremely easy, and very similar to hooking into any permission-plugin. When your plugin is starting up, just grab the Help plugin and register your commands with Help's registerCommand() method; that's it! Here's the API and some examples. If you'd like a concrete example, check out the relevant source code from [URL='https://github.com/tkelly910/MyHome/blob/master/src/main/java/me/taylorkelly/myhome/HomeHelp.java']MyHome[/URL] and [URL='https://github.com/tkelly910/BigBrother/blob/master/src/main/java/me/taylorkelly/bigbrother/BBHelp.java']BigBrother[/URL]. [SIZE=4][FONT=helvetica][B]Help API[/B][/FONT][/SIZE] [CODE] /** * Registers the given command, description, and plugin. * There are no permissions, so all users can see it. * It is also not a "main" help entry. * @return Whether or not it was successful */ public boolean registerCommand(String command, String description, Plugin plugin); /** * Registers the given command, description, and plugin. * There are no permissions, so all users can see it. * You can set whether the plugin is a "main" entry or not * @return Whether or not it was successful */ public boolean registerCommand(String command, String description, Plugin plugin, boolean main); /** * Registers the given command, description, and plugin. * You can specify one or more permissions. * If a user has permissions for at least (1) of them, he can see this command * It is also not a "main" help entry. * @return Whether or not it was successful */ public boolean registerCommand(String command, String description, Plugin plugin, String... permissions); /** * Registers the given command, description, and plugin. * You can specify one or more permissions. * If a user has permissions for at least (1) of them, he can see this command * You can set whether the plugin is a "main" entry or not * @return Whether or not it was successful */ public boolean registerCommand(String command, String description, Plugin plugin, boolean main, String... permissions); [/CODE] [SIZE=4][FONT=helvetica][B]Basic Example[/B][/FONT][/SIZE] [CODE] // plugin is the instance of your Plugin registering the commands Plugin test = plugin.getServer().getPluginManager().getPlugin("Help"); if (test != null) { Logger log = Logger.getLogger("Minecraft"); Help helpPlugin = ((Help) test); // Registers a main command. But all users will be able to see it helpPlugin.registerCommand("home help", "Help for all MyHome commands", plugin, true); // Registers a secondary command to our plugin (MyHome), but the user has to have the permission to see it helpPlugin.registerCommand("home", "Go home young chap!", plugin, "myhome.home.basic.home"); log.log(Level.INFO, "'Help' support enabled."); } else { Logger log = Logger.getLogger("Minecraft"); log.log(Level.WARNING, "'Help' isn't detected. No /help support."); } [/CODE] [SIZE=4][FONT=helvetica][B]Slightly More Advanced Example[/B][/FONT][/SIZE] [CODE] Help helpPlugin = ((Help) test); String[] permissions = new String[]{"bb.admin.watch", "bb.admin.info", "bb.admin.rollback", "bb.admin.cleanse"}; // If a user has any one of those permissions, they'll be able to see /bb help. A main command helpPlugin.registerCommand("bb help", "Help for all BigBrother commands", plugin, true, permissions); // If a user has "bb.admin.watch" they'll be able to see /bb watch [player]. A secondary command helpPlugin.registerCommand("bb watch [player]", "Toggle the watch on [player]", plugin, permissions[0]); [/CODE] [FONT=helvetica][SIZE=5][B]Plugins with Help Support[/B][/SIZE][/FONT] Here's a quick list of plugins (and version) that have built in Help support. - MyHome v1.9.2+ - MyWarp v1.10.3+ - BigBrother v1.6.4+ - Citizens v1.0+ - General 3.1+ - TelePlus 1.6+ - Pixl 1.3+ - Vampire 1.3+ [FONT=helvetica][SIZE=5][B]ExtraHelp Packs[/B][/SIZE][/FONT] [URL='https://github.com/FabianN/MC-Bukkit-HelpExtra']FabianN put together a repository of entries for your ExtraHelp/ that represent other plugins' commands.[/URL] It's really awesome and was helped put together by others from the community. [SIZE=5][B][FONT=helvetica]Preview[/FONT][/B][/SIZE] [IMG]http://i.imgur.com/AE9cG.jpg[/IMG] [IMG]http://i.imgur.com/cII2X.jpg[/IMG] [SIZE=5][B][FONT=helvetica]Changelog[/FONT][/B][/SIZE] [SPOILER="Changelog"] [SIZE=5][FONT=helvetica][B][URL='http://taylorkelly.me/plugins/Help/Help%20v0-2.zip'][COLOR=rgb(16, 97, 179)]Help v0.2 [531][/COLOR][/URL][/B][/FONT][/SIZE] [I]Released 15 Mar, 2011[/I] - Built with latest recommend build (531) - Multiline support. Descriptions of commands can now be as long as you'd like. - Separated ExtraHelp.yml into separate YML files (for each plugin, etc). - Plugin overriding. Don't like how a plugin has their Help support? Completely customize their entries. [SIZE=5][FONT=helvetica][B][URL='http://taylorkelly.me/plugins/Help/Help%20v0-1-1.zip']Help v0.1.1 [493][/URL][/B][/FONT][/SIZE] [I]Released 6 Mar, 2011[/I] - Built with latest recommend build (493) - Updated for GroupManager 1.0 [SIZE=5][FONT=helvetica][B][URL='http://taylorkelly.me/plugins/Help/Help%20v0-1.zip'][COLOR=rgb(16, 97, 179)]Help v0.1 [440][/COLOR][/URL][/B][/FONT][/SIZE] [I]Released 28 Feb, 2011[/I] - Intial Release [/SPOILER]/
     
  2. Offline

    Jellyfrog

    Same here:
    Code:
    18:19:49 [SEVERE] tried to access method me.taylorkelly.help.HelpEntry.save(Ljava/io/File;)V from class me.taylorkelly.help.HelpList loading MyHome v1.9.3 (Is it up to date?)
    java.lang.IllegalAccessError: tried to access method me.taylorkelly.help.HelpEntry.save(Ljava/io/File;)V from class me.taylorkelly.help.HelpList
            at me.taylorkelly.help.HelpList.registerCommand(HelpList.java:167)
            at me.taylorkelly.help.Help.registerCommand(Help.java:159)
            at me.taylorkelly.myhome.HomeHelp.initialize(HomeHelp.java:23)
            at me.taylorkelly.myhome.MyHome.onEnable(MyHome.java:69)
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:118)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:514)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:216)
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:94)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:72)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:215)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:202)
            at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:142)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:257)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
    
    18:19:49 [SEVERE] tried to access method me.taylorkelly.help.HelpEntry.save(Ljava/io/File;)V from class me.taylorkelly.help.HelpList loading Help v0.2 (Is it up to date?)
    java.lang.IllegalAccessError: tried to access method me.taylorkelly.help.HelpEntry.save(Ljava/io/File;)V from class me.taylorkelly.help.HelpList
            at me.taylorkelly.help.HelpList.registerCommand(HelpList.java:167)
            at me.taylorkelly.help.Help.registerCommand(Help.java:151)
            at me.taylorkelly.help.Help.onEnable(Help.java:44)
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:118)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:514)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:216)
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:94)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:72)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:215)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:202)
            at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:142)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:257)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
    
     
  3. Offline

    Celtic Minstrel

    Oh, but that's not true, because Help itself has built-in Help support. :p

    As for the IllegalAccessErrors, I honestly have no idea what could cause that. :( Possibly some kind of version incompatibility?
     
  4. Offline

    Ditto8353

    This is indeed quite strange. I have been trying to think of a reason why it would work fine for me but fail for everyone else. I even double and triple checked to make sure I was truly running RB612. Now that I am running RB617 it continues to work fine as far as I can tell. Here is what I am running:
    AFKBooter, EssentialsGroupManager, FenceStack, Help, iChat, LocalShops
     
  5. Offline

    derchris

    Has to be something with Plugins using Help.
    Not really botheres about it, as it is just a private server of a few friends, but would be nice if it would work even with these other Plugins enabled.
     
  6. Offline

    PatrickFreed

    I'm about to add all my extra helps on v 0.1.1, and I was wondering if that is a bad idea as it says the formatting changes.
     
  7. Offline

    Celtic Minstrel

    Yeah, I'm on 617 too and it works just fine.
     
  8. Offline

    khamseen_air

    I'm getting this on 617
    Code:
    [SEVERE] tried to access method me.taylorkelly.help.HelpEntry.save(Ljava/io/File;)V from class me.taylorkelly.help.HelpList loading Help v0.2 (Is it up to date?)
    java.lang.IllegalAccessError: tried to access method me.taylorkelly.help.HelpEntry.save(Ljava/io/File;)V from class me.taylorkelly.help.HelpList
    	at me.taylorkelly.help.HelpList.registerCommand(HelpList.java:167)
    	at me.taylorkelly.help.Help.registerCommand(Help.java:151)
    	at me.taylorkelly.help.Help.onEnable(Help.java:44)
    	at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:118)
    	at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:514)
    	at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:216)
    	at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:94)
    	at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:72)
    	at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:215)
    	at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:202)
    	at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:142)
    	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:257)
    	at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
    Currently I have the following plugins installed;
    Paintings on Scroll
    Fish People
    Permissions
    Falsebook (cart only jar)
    Pickboat
    MyHome
    LoginMOTD
     
  9. Offline

    Envy's Legacy

    When Ever I Type the "/help" command it gives me an in game error saying, "An Internal Error Occurred While Attempting To Perform This Command". Can anyone help me?
     
  10. Offline

    jascotty2

    the IllegalAccessErrors were annoying me, too..
    Version 0.2.4
    fixed a pesky illegalAccess error that was occurring in 612+
     
  11. Offline

    cepheus

    Seems to be further problems with this plugin with the latest builds. I've attatched a fixed .jar which will fix the (trivial) "Internal Error Occurred" problem when using /help, but there seem to be issues with registering plugin help using the API.

    Fixed Jar: Here

    To ensure I don't get into licensing legal issues in the nasty world of software, advanced users and developers can find the simple patch here (from jascotty2's fix branch, which can be found here).
     
  12. Offline

    DJ411

    if if this is a glitch or what but when i used this i'm getting like 5 pages of commands. I only have DefaultCommands installed and when i do /help its giving me commands i don't even have!!
     
  13. Offline

    Alex K

    I have a question, TKelly. If I wanted to make a command like...../how, which informs them how they gain the ability to build or something, It doesn't really let me. Is there a plugin out there that lets you add custom command to the help menu?
     
  14. Offline

    FabianN

    MCDocs.
     
  15. Offline

    khamseen_air

    Well at first it seemed to help, my server log showed it had loaded up without a hitch, but then as soon as I typed "/help" in the console it threw this into my server log;
    Code:
    [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'help' in plugin Help v0.2.4
    	at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
    	at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:80)
    	at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:233)
    	at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:594)
    	at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:557)
    	at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:551)
    	at net.minecraft.server.Packet3Chat.a(SourceFile:24)
    	at net.minecraft.server.NetworkManager.a(NetworkManager.java:198)
    	at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:72)
    	at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    	at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:368)
    	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283)
    	at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
    Caused by: java.lang.IllegalAccessError: tried to access method me.taylorkelly.help.Lister.<init>(Lme/taylorkelly/help/HelpList;Lorg/bukkit/command/CommandSender;)V from class me.taylorkelly.help.Help
    	at me.taylorkelly.help.Help.onCommand(Help.java:64)
    	at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
    	... 12 more]
     
  16. Offline

    Dutchy

  17. Offline

    jascotty2

    my server doesn't throw that error, but i went through the code and found that the constructor wasn't public (weird)
    (also found a few other classes that didn't have public constructors)
    so: 0.2.4.1 should hopefully resolve that
     
    BPCM likes this.
  18. Offline

    khamseen_air

    Indeed it has resolved the issue, all working as intended now. Thank you so much for the update! :)
     
  19. Offline

    Celtic Minstrel

    Do those commands include things like /ban and /kick? If so, you probably don't have the Help plugin installed.
     
  20. Offline

    Sense545

  21. Offline

    Kiithnaras

    Forgive me for asking an exceedingly simple question, but...what exactly are the permissions nodes entered into GroupManager/Permissions for using this plugin's commands? I can't seem to find them anywhere on this thread. My amateur attempts at navigating the source code are also in vain.
     
  22. Offline

    snydez2009

    How do I go about adding my extra permissions files to FabianN's repository?
     
  23. Offline

    mxms

    This is working fine, except it will not let me touch the MyHome_orig and Help_orig files! Every time I edit them and save, then reload the server they get overwritten with the defaults again. I tried renaming them, and setting them to read only to no avail. Pretty maddening.
     
  24. Offline

    Celtic Minstrel

    Rename them to get rid of the "_orig" part, and then edit them.
     
  25. Offline

    ToshNeox

    This help menu isn't working for me. It would be a lot simpler to have a folder in plugins with one YML file which contains all the settings. I can't get any other help items to appear. Even using /help essentials isn't working, and EVEN when I have placed YML files for it everywhere. This is sorta' frustrating!

    EDIT://
    As of reading "Celtic Minstrel's" post, it is now working better :) I still suggest that idea though
     
  26. Offline

    BPCM

    I've started using this and it works perfectly on 617, thanks so much.

    On a side note, you can still NOT fully modify helpfiles such as MyHome.yml or Help.yml. Commands generated by Help which that have the attribute main:true will always stay as such regardless on if it is edited or not.
    If anyone could please fix this it would be highly appreciated.
     
  27. Offline

    jascotty2

    i'm working on many plugins right now, and looking for a job, and working on school all at once..
    i'll add when i get to it, but i'm a little booked ;)
     
  28. Offline

    ssechaud

    9:25:26 [SEVERE] [HELP] Error!
    java.lang.NullPointerException
    at me.taylorkelly.help.HelpLoader.load(HelpLoader.java:32)
    at me.taylorkelly.help.Help.onEnable(Help.java:38)
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:118)
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:514)
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:216)
    at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:94)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:72)
    at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:215)
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:202)
    at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:142)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:257)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
     
  29. Offline

    khamseen_air

    0.2.4.1 is also working well in CB670.
     
    Fantikerz likes this.
  30. Offline

    Bjourk

    Help is still working great!
    Attached are my Lottery ExtraHelp entry and my temporary BlastControl entry.
    BlastControl.yml currently only gives info for "/bc help", since that command already lists the rest.
     

    Attached Files:

  31. Offline

    untergrundbiber

    No function with CB670
    Code:
    17:08:03 [SEVERE] null
    
    org.bukkit.command.CommandException: Unhandled exception executing command 'help' in plugin Help v0.2
    
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
    
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:80)
    
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:254)
    
    at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:596)
    
    at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:559)
    
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:553)
    
    at net.minecraft.server.Packet3Chat.a(SourceFile:24)
    
    at net.minecraft.server.NetworkManager.a(NetworkManager.java:198)
    
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:72)
    
    at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:368)
    
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283)
    
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
    
    Caused by: java.lang.IllegalAccessError: tried to access method me.taylorkelly.help.Lister.<init>(Lme/taylorkelly/help/HelpList;Lorg/bukkit/entity/Player;)V from class me.taylorkelly.help.Help
    
    at me.taylorkelly.help.Help.onCommand(Help.java:65)
    
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
    
    ... 12 more
     

Share This Page