Inactive [INFO] Help 3 - a Smarter /help [1060]

Discussion in 'Inactive/Unsupported Plugins' started by jascotty2, Apr 19, 2011.

  1. Offline

    jascotty2

    Help - The Smart /help Menu
    Version: 0.3.2
    Download: Help.jar

    This is a new thread for the Help version that i maintain
    (tkelly hasn't been on for about a month as of this submission, and no updates to his version since 531)

    Version 0.3 is (finally) out! :D

    (any suggestions for what to work on next are welcome ;) )


    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. [SIZE=5][B][FONT=helvetica]Plugin Support[/FONT][/B][/SIZE] 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][B][FONT=helvetica]Custom ExtraHelp/[/FONT][/B][/SIZE] I'll also cover how you can add custom commands to the /help menu 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 [FONT=Georgia][U][I][B]need[/B][/I][/U][/FONT] [B][SIZE=4]2[/SIZE][/B] things: command, description, [SIZE=2][S]and plugin[/S][/SIZE]. These should be self-explanatory. The two optional pieces are "main" and "permissions" [INDENT=1]The previously required "plugin" node has been replaced by the filename itself.[/INDENT] [INDENT=1]so if you have entries for "Minecraft", put those entries within "Minecraft.yml" in help's ExtreHelp folder.[/INDENT] [INDENT=1]If you have many commands & don't want them cluttering the same file (like worldedit), you can put them in a folder instead (the folder name will be the name used for plugin)[/INDENT] 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] [spoiler="API"] 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'][COLOR=rgb(16, 97, 179)]MyHome[/COLOR][/URL] and [URL='https://github.com/tkelly910/BigBrother/blob/master/src/main/java/me/taylorkelly/bigbrother/BBHelp.java'][COLOR=rgb(16, 97, 179)]BigBrother[/COLOR][/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); /** * Gets the help text associated with this command * @param command the command to lookup * @return help text, or null if none */ public String getHelp(String command); /** * Gets all of the commands registered with this plugin * @param plugin plugin to lookup * @return list of commands */ public ArrayList getPluginCommands(String plugin); [/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] [/spoiler] [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+ - BetterShop 1.6.2+ - Wormhole-X-Treme 0.812+ - Tele++ v1.3.4 [FONT=helvetica][SIZE=5][B]ExtraHelp Packs[/B][/SIZE][/FONT] [URL='https://github.com/FabianN/MC-Bukkit-HelpExtra'][COLOR=rgb(16, 97, 179)]FabianN put together a repository of entries for your ExtraHelp/ that represent other plugins' commands.[/COLOR][/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] Version 0.3.2 - 7/21/11 [LIST] [*]lowered chat fill size.. should fix some wrapping issues [/LIST] Version 0.3.1 - 7/7/11 [LIST] [*]fixed NullPointerException on entry save when no permissions [/LIST] Version 0.3 - 7/6/11 [LIST] [*]fixed loading help & plugin help registering before plugin onEnable [/LIST] [spoiler="Changelog"] Version 0.3 beta2 - 7/4/11 [LIST] [*]plugin console output fixed [*]console output width changed for when running windows [*]plugin help override can be disabled (default) [LIST] [*]plugin help registering is ignored if the command exists already [*]alternatively, can be disabled completely [/LIST] [*]saving of registered commands can be disabled (also, now saves to file, not "_orig" files) [*]ExtraHelp now uses filename as plugin name (plugin field no longer used) [*]added formatting options: [LIST] [*]shortenEntries : can show in old, one-line style [*]chat line (useWordWrap:false) - minecraft chat wraps to next line [*]columns (useWordWrap:true) - command on left, description in word wrap line(s) [LIST] [*]can be right-aligned (wordWrapRight:true) [/LIST] [/LIST] [*]plugin entries can be set to not sorted (listed in the order found in the help file) [*]"/help reload" is now op-only [*]"ExtraHelp.yml" will now be converted (again.. seems to have been removed somewhere..) [*]ExtraHelp supports a multi-directory structure (like FabiaN's help package) (plugin name will be the directory name) [*]improved node error messages when loading [*]fixed permissions 3x illegalAccessErrors on load (and api errors) [/LIST] Version 0.2.4.1 - 4/4/11 [LIST] [*]another illegalAccessError (hopefully) resolved [/LIST] Version 0.2.4 - 4/2/11 [LIST] [*]updated an illegalAccess error that was occurring in 617 [/LIST] Version 0.2.3 - 3/25/11 [LIST] [*]fixed a null pointer exception in plugin help [/LIST] Version 0.2.2 - 3/24/11 [LIST] [*]various null pointer fixes (could have nullpointerException on load without) [*]improved help listing [*]added console help support [/LIST] [SIZE=5][FONT=helvetica]Before i started maintaining: [/FONT][/SIZE] [I][SIZE=12px][SIZE=5][FONT=helvetica][B][URL='http://taylorkelly.me/plugins/Help/Help%20v0-2.zip'][COLOR=rgb(16, 97, 179)][COLOR=rgb(16, 97, 179)]Help v0.2 [531][/COLOR][/COLOR][/URL][/B][/FONT][/SIZE][/SIZE][/I] [I][SIZE=12px][I]Released 15 Mar, 2011[/I][/SIZE][/I] [I][SIZE=12px]- Built with latest recommend build (531)[/SIZE][/I] [I][SIZE=12px]- Multiline support. Descriptions of commands can now be as long as you'd like.[/SIZE][/I] [I][SIZE=12px]- Separated ExtraHelp.yml into separate YML files (for each plugin, etc).[/SIZE][/I] [I][SIZE=12px]- Plugin overriding. Don't like how a plugin has their Help support? Completely customize their entries.[/SIZE][/I] [I][SIZE=12px][SIZE=5][FONT=helvetica][B][URL='http://taylorkelly.me/plugins/Help/Help%20v0-1-1.zip'][COLOR=rgb(16, 97, 179)]Help v0.1.1 [493][/COLOR][/URL][/B][/FONT][/SIZE][/SIZE][/I] [I][SIZE=12px][I]Released 6 Mar, 2011[/I][/SIZE][/I] [I][SIZE=12px]- Built with latest recommend build (493)[/SIZE][/I] [I][SIZE=12px]- Updated for GroupManager 1.0[/SIZE][/I] [I][SIZE=12px][SIZE=5][FONT=helvetica][B][URL='http://taylorkelly.me/plugins/Help/Help%20v0-1.zip'][COLOR=rgb(16, 97, 179)][COLOR=rgb(16, 97, 179)]Help v0.1 [440][/COLOR][/COLOR][/URL][/B][/FONT][/SIZE][/SIZE][/I] [I][SIZE=12px][I]Released 28 Feb, 2011[/I][/SIZE][/I] [I][SIZE=12px]- Intial Release[/SIZE][/I] [\spoiler]/
     
  2. Offline

    jascotty2

    @unl33t
    looked over the stacktrace & notice i'd accidently removed pre-enable registering
    so:
    Version 0.3
    fixed loading help & plugin help registering before plugin onEnable
    - & removed beta label
     
  3. Offline

    unl33t

    @jascotty2
    that did it, everything is loading just find again. THANKS!:D
     
  4. Offline

    Tadas159

    Why do i get this?

    Code:
    2011-07-07 17:34:13 [SEVERE] Could not load 'plugins\Help.jar' in folder 'plugins':
    java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:173)
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:199)
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:122)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:118)
        at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:89)
        at net.minecraft.server.ServerConfigurationManager.<init>(ServerConfigurationManager.java:51)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:132)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:335)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.lang.NullPointerException
        at me.taylorkelly.help.HelpEntry.save(HelpEntry.java:144)
        at me.taylorkelly.help.HelpList.registerCommand(HelpList.java:244)
        at me.taylorkelly.help.HelpList.registerCommand(HelpList.java:230)
        at me.taylorkelly.help.HelpList.customHelp(HelpList.java:307)
        at me.taylorkelly.help.HelpList.<init>(HelpList.java:28)
        at me.taylorkelly.help.Help.<init>(Help.java:27)
        ... 13 more
     
  5. Offline

    jascotty2

    Version 0.3.1
    fixed NullPointerException on entry save when no permissions

    @Tadas159
    try re-downloading & see if that fixes it..
     
  6. Offline

    Martin-zz

    updating to 0.3 fixed this problem for me :)
     
  7. Offline

    Tusing

    It ees broek!

    Code:
    15:35:06 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'help' in plugin Help v0.3.1
    	at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
    	at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:129)
    	at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:298)
    	at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:711)
    	at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:676)
    	at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:669)
    	at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:33)
    	at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
    	at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:84)
    	at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
    	at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
    	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
    	at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.lang.IllegalAccessError: tried to access field me.taylorkelly.help.Help.settings from class me.taylorkelly.help.Lister
    	at me.taylorkelly.help.Lister.setPage(Lister.java:49)
    	at me.taylorkelly.help.Lister.<init>(Lister.java:24)
    	at me.taylorkelly.help.Lister.<init>(Lister.java:32)
    	at me.taylorkelly.help.Help.onCommand(Help.java:62)
    	at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
    	... 12 more
    
    Or am I doing something wrong?
     
  8. Offline

    Wulfspider

    Just an idea for you...

    How about adding support for BukkitContrib? You could probably use it to have a custom Help button somewhere on the client or UI or just use the /help to bring it up. Perhaps even a way to keep your place on the GUI and automatically grabbing default commands from plugins if no custom pages are found?
     
  9. Offline

    Celtic Minstrel

    Automatically grabbing commands from plugins and stuffing them into Help is already done by the AutoHelp plugin.

    Anyway, there's a bug in the line wrapping. I have some commands that have a lot of space between the command and the description, and the terminating period (and nothing else) is wrapped onto the next line. I can get a screenshot if you like.
     
  10. Offline

    Fob_Upset

    PermissionsEX is bugged, i made all Help Entry main: False as the permissions for help for that plugin is bugged, as guests can see all the commands when they do /help.
    So i reload and it doesn't take effect.

    I look back at the help entry and remove all the Main: true entry's as it won't let me change it, so i reload again only to it not taking affect.

    So i finally delete the help entry and reload only for it to re-generate itself again.


    Please fix this bug or allow me to remove entry's without them re-generating.
     
  11. Offline

    Dalton Just

    I don't understand, all it says is 2 things when I do /help as owner of the server.

    It says:

    /help http://dev.bukkit.org/bukkit-plugins/ /help Help and /help Help doesn't even display any of my commands.../
     
  12. Offline

    Celtic Minstrel

    You need to either set up your help files, or use plugins that do it for you. AutoHelp is one plugin you may want to consider.
     
  13. Offline

    Telo

    why so bad word warp?
    [​IMG]
     
  14. Offline

    Celtic Minstrel

    I reported that already.
     
  15. Offline

    jascotty2

    lowered the chat fill size, so that should resolve character issues..
    but not sure what could've caused telo's screenshot... there's plenty of room for the descriptions, but words wrapped to next line? .... very odd..
    i would like to see what may be causing that, if you could compress your Help folder to send me ;)
     
  16. Offline

    Celtic Minstrel

    @jascotty2 – I had the same issue, and it occurred for the General help added through the API as well, as I recall.
     
  17. Offline

    BPCM

    Does anyone know what the permissions nodes are for this plugin? I can't seem to find them. I'd like to give Admins the ability to reload help configs : )
     
  18. Offline

    Celtic Minstrel

    I think it's help.reload, but not sure.
     
  19. Offline

    Mukrakiish

    I can get other help commands to work but if its /help help or just /help, it'll crap out on me with this. Dunno what's going on. Dry & clean install.

    Code:
    org.bukkit.command.CommandException: Unhandled exception executing command 'help' in plugin Help v0.3.2
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:129)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:320)
        at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:713)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:677)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:670)
        at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:33)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:85)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.lang.IllegalAccessError: tried to access field me.taylorkelly.help.Help.settings from class me.taylorkelly.help.Lister
        at me.taylorkelly.help.Lister.setPage(Lister.java:49)
        at me.taylorkelly.help.Lister.<init>(Lister.java:24)
        at me.taylorkelly.help.Lister.<init>(Lister.java:28)
        at me.taylorkelly.help.Help.onCommand(Help.java:140)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
     
  20. Offline

    Switch0r

  21. Offline

    Celtic Minstrel

    AutoHelp is intended to work along with Help; in fact, it probably wouldn't work without it.
     
  22. Offline

    Lathanael

    Oh it does work without it. You just have to create extra Help files and keep the updated manually.
     
  23. Offline

    Celtic Minstrel

    I meant that AutoHelp won't work without Help, not that Help won't work without AutoHelp.
     
  24. Offline

    Lathanael

    ooops sry did understand it the other way around
     
  25. Offline

    Firewolf34

    Great! I have been looking for something like this.
     
  26. Offline

    rbos

    I'm getting the same error that Mukrakiish reports.

    Code:
    org.bukkit.command.CommandException: Unhandled exception executing command 'help' in plugin Help v0.3.2
     
  27. Offline

    Robert Pendell

    Has anyone checked to see if this works with 1060 ok?
     
  28. Offline

    Spendy

    Thanks for the plugin =) its helpful. You may want to update it though before they deem it INACTIVE =/
     
  29. Offline

    Celtic Minstrel

    It's only two recommended builds behind; they won't mark it inactive until it's three behind, if I recall correctly.
     
  30. Offline

    Rofang

    I really like this plugin, and I wrote quite a number of /ExtraHelp dictionaries for my own use, but it doesn't appear to support SuperPerms (even with the SuperPermsBridge plugin associated with PermissionsBukkit). This is a shame, as I'm wishing to switch to SuperPerms for my permissions management, but hardly any of my /ExtraHelp items show up (only /help Help and /help Perm).

    Edit: Got everything working nicely with PermissionsEx! Yay!
     
  31. Offline

    Fyrecrypts

    Don't suppose you'd be willing to share any of those ExtraHelp files? =D
     

Share This Page