aboutsummaryrefslogtreecommitdiff
path: root/data/mods/experimental/init.lua
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-01-24 12:01:59 +0200
committerPerttu Ahola <celeron55@gmail.com>2012-01-24 12:01:59 +0200
commit2e8e9ee7f5c0fa638e5a427f34b6823892c84f7c (patch)
tree9f0fa7c3daa75ae5a688dfba585f25e78684f913 /data/mods/experimental/init.lua
parentcb05a28745ae4f4f6ad6f4b922bc1b465c6287fa (diff)
downloadminetest-2e8e9ee7f5c0fa638e5a427f34b6823892c84f7c.tar.gz
minetest-2e8e9ee7f5c0fa638e5a427f34b6823892c84f7c.tar.bz2
minetest-2e8e9ee7f5c0fa638e5a427f34b6823892c84f7c.zip
Add EnvRef:set_timeofday(0...1) and EnvRef:get_timeofday()
Diffstat (limited to 'data/mods/experimental/init.lua')
-rw-r--r--data/mods/experimental/init.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/data/mods/experimental/init.lua b/data/mods/experimental/init.lua
index 368295ea7..9a8f8868d 100644
--- a/data/mods/experimental/init.lua
+++ b/data/mods/experimental/init.lua
@@ -4,6 +4,8 @@
-- For testing random stuff
+experimental = {}
+
function on_step(dtime)
-- print("experimental on_step")
--[[
@@ -20,6 +22,26 @@ function on_step(dtime)
end
end
--]]
+ --[[
+ if experimental.t1 == nil then
+ experimental.t1 = 0
+ end
+ experimental.t1 = experimental.t1 + dtime
+ if experimental.t1 >= 2 then
+ experimental.t1 = experimental.t1 - 2
+ minetest.log("time of day is "..minetest.env:get_timeofday())
+ if experimental.day then
+ minetest.log("forcing day->night")
+ experimental.day = false
+ minetest.env:set_timeofday(0.0)
+ else
+ minetest.log("forcing night->day")
+ experimental.day = true
+ minetest.env:set_timeofday(0.5)
+ end
+ minetest.log("time of day is "..minetest.env:get_timeofday())
+ end
+ --]]
end
minetest.register_globalstep(on_step)