[Mod] worldtime mod [1.01] [worldtime]

Posted:
Thu Jun 28, 2012 23:32
by Bad_Command_
Hi, announcing the worldtime mod. The mod is on
github.
The worldtime mod adds some time managment functionality to minetest. It adds no new blocks or objects or behaviors, but instead is a library that can be used by other mods.
Downloads:Version 1.01Version 1.00License:LGPL 2.1 for code
No media
See the github wiki page for information about how to use the mod.

Posted:
Fri Jun 29, 2012 06:51
by cy
I would recommend you use the "minetest.after" function instead of registering something to run every server step.
minetest.after(10,worldtime_timechange);
Also your module should use local functions and variables, and at the bottom return the interface for other modules to use it. (i.e. a get world time function)
Honestly it seems that using the lua "os.time()" function to get the current Unix time would be the best thing to do in this situation. Isn't the elapsed time for active block modifiers based on that, and not on length of server execution?

Posted:
Fri Jun 29, 2012 08:06
by Bad_Command_
This mod intentionally does not use os.time. It uses ... world time. World time only progresses while the map is running. The real time clock keeps ticking when the world is closed; this does not.
World time progresses every server step because time progresses with every server step.
I'll look in to better encapsulation for a following version.

Posted:
Thu Jul 05, 2012 05:48
by Bad_Command_
Version 1.01 released. This update fixes possible floating point underflow problems.

Posted:
Thu Mar 28, 2013 16:54
by sfan5-bot
[EE] No Dependencies found
Please fix these Mistakes and report this post, a moderator will delete it
If you believe I have made a Mistake contact
sfan5