Cuberite Forum
A noob's question - 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: A noob's question (/thread-1516.html)



A noob's question - jimmis98 - 07-03-2014

As far as I know, mc-server is the one calling the plugins. Could there be a plugin that would call other plugins too?


RE: A noob's question - NiLSPACE - 07-03-2014

You mean Inter-plugin communication? We use the cPluginManager:CallPlugin function to call other plugins.


RE: A noob's question - jimmis98 - 07-03-2014

I could use that, but by thinking more thoroughly, maybe it would be more modular if, technically, I were to be able to create new hooks in a plugin.
Let's say I wanted to make a plugin that would count ticks and every 24000 ticks would register an event and mc-server would then be responsible to call the plugin(s) that would use my new "hook". How would I make such a thing? Is it even possible?

I didn't mean to rate the thread, I was courious to see if I could rate something I had posted....


RE: A noob's question - NiLSPACE - 07-03-2014

If you want your plugin to create its own hooks, and you want other plugins to hook into them then you probably have to do it the same way our WorldEdit plugin does it. Other plugins can call a function in WorldEdit to register a function. Whenever a certain action happens WorldEdit will call the function from the plugin.


RE: A noob's question - worktycho - 07-03-2014

Note that the way you call something every 24000 ticks would not be counting ticks. Use the scheduleTask call.