aboutsummaryrefslogtreecommitdiff
path: root/data/mods
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-11-26 15:19:03 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-11-29 19:13:54 +0200
commit769cc9879f306055e683bf720b0877a364e82ba5 (patch)
tree30ff59e05cf71e445825e1f95c7d544f63d4ff73 /data/mods
parent0dbb31afeb74c199bb66eaf95d3e23f2fa843386 (diff)
downloadminetest-769cc9879f306055e683bf720b0877a364e82ba5.tar.gz
minetest-769cc9879f306055e683bf720b0877a364e82ba5.tar.bz2
minetest-769cc9879f306055e683bf720b0877a364e82ba5.zip
Add on_generated hook
Diffstat (limited to 'data/mods')
-rw-r--r--data/mods/default/init.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/data/mods/default/init.lua b/data/mods/default/init.lua
index 88f457e29..6ea15b4ee 100644
--- a/data/mods/default/init.lua
+++ b/data/mods/default/init.lua
@@ -15,6 +15,7 @@
-- minetest.register_on_placenode(func(pos, newnode, placer))
-- minetest.register_on_dignode(func(pos, oldnode, digger))
-- minetest.register_on_punchnode(func(pos, node, puncher))
+-- minetest.register_on_generated(func(minp, maxp))
-- minetest.register_on_newplayer(func(ObjectRef))
-- minetest.register_on_respawnplayer(func(ObjectRef))
-- ^ return true in func to disable regular player placement
@@ -1329,6 +1330,12 @@ minetest.register_on_respawnplayer(function(player)
-- return true
end)
+minetest.register_on_generated(function(minp, maxp)
+ --print("on_generated: minp="..dump(minp).." maxp="..dump(maxp))
+ --cp = {x=(minp.x+maxp.x)/2, y=(minp.y+maxp.y)/2, z=(minp.z+maxp.z)/2}
+ --minetest.env:add_node(cp, {name="sand"})
+end)
+
-- Example setting get
print("setting max_users = " .. dump(minetest.setting_get("max_users")))
print("setting asdf = " .. dump(minetest.setting_get("asdf")))