Lua hooks needed! - Printable Version +- Cuberite Forum (https://forum.cuberite.org) +-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html) +--- Forum: Development (https://forum.cuberite.org/forum-13.html) +--- Thread: Lua hooks needed! (/thread-464.html) |
RE: Lua hooks needed! - xoft - 02-15-2013 The first function alone should be enough to make the weather constant sunny. The second function is not needed at all (and MCServer ignores the second return value, "-ed" functions are notifications only, meaning "it has already happenned, you cannot do anything about it") RE: Lua hooks needed! - Taugeshtu - 02-15-2013 I had a thought right now... Is there any way to know if weather was changed via API or automatically by server needs? Because some would like to make the weather constantly sunny, but still be able to have a manual rain sometimes... RE: Lua hooks needed! - xoft - 02-15-2013 There is currently no way. If you wanted to make manual rain, have a variable in your Lua code that would signal if the plugin itself is changing weather or it's an external change. Of course, that's limited to a single plugin. How I would do it, though - make a plugin that can make constant weather, any weather. So then you just switch from "constant sunny" to "constant rain" and back. RE: Lua hooks needed! - NiLSPACE - 02-17-2013 can there be a HOOK_PLAYER_MOVED becouse HOOK_PLAYER_MOVING keeps activating even if i don't move RE: Lua hooks needed! - FakeTruth - 02-17-2013 Yes you do, just a tiny little bit :O RE: Lua hooks needed! - NiLSPACE - 02-18-2013 (02-17-2013, 10:23 PM)FakeTruth Wrote: Yes you do, just a tiny little bit :O wait what? RE: Lua hooks needed! - FakeTruth - 02-18-2013 You move a tiny little bit, otherwise the function is not called. Minecraft slows down the player movement by dividing or something, and that results in ~0.000001 units of movement per tick RE: Lua hooks needed! - NiLSPACE - 02-18-2013 no i am not moving at all but it still keeps calling it RE: Lua hooks needed! - FakeTruth - 02-18-2013 If you don't move for a whole minute it still gets called? RE: Lua hooks needed! - NiLSPACE - 02-18-2013 jup i added LOG("TEST") and my console spammed completly. about every 1-2 seconds i got TEST in my console |