aboutsummaryrefslogtreecommitdiff
path: root/data/mods
diff options
context:
space:
mode:
Diffstat (limited to 'data/mods')
-rw-r--r--data/mods/default/init.lua6
-rw-r--r--data/mods/experimental/init.lua22
2 files changed, 26 insertions, 2 deletions
diff --git a/data/mods/default/init.lua b/data/mods/default/init.lua
index 7c6cccd44..f0e6b6dc2 100644
--- a/data/mods/default/init.lua
+++ b/data/mods/default/init.lua
@@ -114,10 +114,10 @@
-- minetest.chat_send_player(name, text)
-- minetest.get_player_privs(name) -> set of privs
-- minetest.get_inventory(location) -> InvRef
--- minetest.get_current_modname() -> string
--- minetest.get_modpath(modname) -> eg. "/home/user/.minetest/usermods/modname"
-- ^ location = eg. {type="player", name="celeron55"}
-- {type="node", pos={x=, y=, z=}}
+-- minetest.get_current_modname() -> string
+-- minetest.get_modpath(modname) -> eg. "/home/user/.minetest/usermods/modname"
--
-- minetest.debug(line)
-- ^ Goes to dstream
@@ -169,6 +169,8 @@
-- - get_meta(pos) -- Get a NodeMetaRef at that position
-- - get_player_by_name(name) -- Get an ObjectRef to a player
-- - get_objects_inside_radius(pos, radius)
+-- - set_timeofday(val): val: 0...1; 0 = midnight, 0.5 = midday
+-- - get_timeofday()
--
-- NodeMetaRef (this stuff is subject to change in a future version)
-- - get_type()
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)