Cuberite Forum
Function Hook Discussion - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Plugins (https://forum.cuberite.org/forum-1.html)
+--- Forum: Plugin Discussion (https://forum.cuberite.org/forum-8.html)
+--- Thread: Function Hook Discussion (/thread-213.html)



Function Hook Discussion - Luthrandel - 11-06-2011

The current list of hooks, while not particularly bad, are a little restrictive. It is not necessary for lua plugins to do everything but for Mc-Server to be a serious competitor with the notch server long term we're gonna need a wide range of plugin capabilities to match.

So I thought we could use a thread to discuss possible function hooks, their uses, and what can be improved on existing ones.

To start with...
The hook E_PLUGIN_BLOCK_PLACE is great but not universally useful. It tends not to trigger if no block can be placed in that spot. Makes sense, right? Except we have no alternative on the right click button. Sure, it's fine for long ranged stuff but what of block interaction?

I propose a slight change. E_PLUGIN_BLOCK_PLACE gets called only right before an actual block is placed and the alternative hook E_PLUGIN_RIGHT_CLICK gets called otherwise. Thoughts?