Cuberite Forum
[DONE] OnWeatherChanging API change - 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: [DONE] OnWeatherChanging API change (/thread-1512.html)



[DONE] OnWeatherChanging API change - xoft - 07-02-2014

I'd like to change the OnWeatherChanging hook's behavior slightly.
http://mc-server.xoft.cz/LuaAPI/OnWeatherChanging.html
To recap, it uses the second return value only if the plugin returns true (blocks other plugins' callbacks). I'd like to change that so that the server always uses the second value returned as the new weather, and defaults to the new weather in the parameter if the plugin doesn't return a second value.
I don't think this change should break any plugins, but I'd like to hear opinions about this before I do the change.

The main reason for this is unification with the other callbacks - the OnUpdatingSign, for example, which always uses the extra return values. A secondary reason is that the Lua CodeGen that I'm writing for the hooks will be easier with this change.


RE: OnWeatherChanging API change - NiLSPACE - 07-02-2014

I moved it to "Plugin Discussion"

But I think this is a reasonable change. Smile


RE: OnWeatherChanging API change - xoft - 07-03-2014

Must've clicked the wrong subforumTongue Thanks for the move-fix.


RE: OnWeatherChanging API change - xoft - 07-04-2014

Changed.