Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Make output public. #94

wants to merge 1 commit into


None yet
4 participants

By making output public, other plugins can hook into Towny.

Make output public.
By making output public, other plugins can hook into Towny.

riking commented Jun 5, 2013

This seems like... a very wrong way to do this. Hang on while I investigate the code.

riking commented Jun 5, 2013

The only thing that would do is let other plugins change the help text - it doesn't let them actually add any subcommands, which is what I would call "hooking into Towny" (for this class, at least).

Well, I only pushed through one line (word even :p) change. But yes I need to be able to change the help, and add sub commands. I really worded that badly.. my apologises!

What're your thoughts on this anyway? Would you allow plugins to hook in and add subcommands, etc?

riking commented Jun 6, 2013

Yeah.... i'm saying that this doesn't actually let you do what you're trying to do.

I understand that.. I was asking for your general thoughts on allowing access to modify help, and add sub commands.

I had only tested this in adding help to the one command.

As far as my understanding is, you can only hook into commands via PlayerCommandPreprocessEvent. Towny (as far as I can see) doesn't have any function that manages individual commands or whatnot.


Zren commented Jun 7, 2013

That's only if you want to add top level commands like /blarg or /test. If would be possible to create a manager for subcommands of commands Towny already hooks like /towny test. Thing is, the subcommands in Towny aren't modular (they aren't dynamically added) but are instead hardcoded in a large if command equals "test" else tree.

Making the help test public would allow for users to add their own top level commands into the list though. Thing is, I don't believe the help text is pagerized/broken into pages. So any extra lines that are added would require the user to press t to view the chat log as the list would send more than the 8? or so lines that are immediately viewable.

Note: You can (could?) dynamically add top level commands if you compiled against CraftBukkit. But shhhhh, that's suppose to be evil.

This is basically what I'm doing to hook in already:

Maybe we should work on a command manager, I could make my plugin attempt to override the help command itself. But that means, in future versions of Towny it would not show any modifications to help. (which is a bit rude)


ElgarL commented Mar 31, 2014

A command manager will get here one day

@ElgarL ElgarL closed this Mar 31, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment