summaryrefslogtreecommitdiff
path: root/data/mods
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-11-28 03:06:21 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-11-29 19:13:56 +0200
commit0f2b932e9205a4f6cf49accad00835999b379a0c (patch)
treeba23dacc2211560a76922e0a5d21bf6185cb8f3e /data/mods
parent34bd1b3032963a35b3dcdfb3d1866020002063a1 (diff)
downloadminetest-0f2b932e9205a4f6cf49accad00835999b379a0c.tar.gz
minetest-0f2b932e9205a4f6cf49accad00835999b379a0c.tar.bz2
minetest-0f2b932e9205a4f6cf49accad00835999b379a0c.zip
Initial NodeMetaRef stuff
Diffstat (limited to 'data/mods')
-rw-r--r--data/mods/default/init.lua25
1 files changed, 23 insertions, 2 deletions
diff --git a/data/mods/default/init.lua b/data/mods/default/init.lua
index c59c34fc7..3954c717f 100644
--- a/data/mods/default/init.lua
+++ b/data/mods/default/init.lua
@@ -44,6 +44,10 @@
-- - remove_node(pos)
-- - get_node(pos)
-- - add_luaentity(pos, name)
+-- - get_meta(pos) -- Get a NodeMetaRef at that position
+--
+-- NodeMetaRef
+-- - settext(text) -- eg. set the text of a sign
--
-- ObjectRef is basically ServerActiveObject.
-- ObjectRef methods:
@@ -1359,7 +1363,8 @@ minetest.register_on_chat_message(function(name, message)
end
end)
-minetest.register_abm({
+-- Grow papyrus on TNT every 10 seconds
+--[[minetest.register_abm({
nodenames = {"TNT"},
interval = 10.0,
chance = 1,
@@ -1368,7 +1373,23 @@ minetest.register_abm({
pos.y = pos.y + 1
minetest.env:add_node(pos, {name="papyrus"})
end,
-})
+})]]
+
+-- Replace texts of alls signs with "foo" every 10 seconds
+--[[minetest.register_abm({
+ nodenames = {"sign_wall"},
+ interval = 10.0,
+ chance = 1,
+ action = function(pos, node, active_object_count, active_object_count_wider)
+ print("ABM: Sign text changed")
+ local meta = minetest.env:get_meta(pos)
+ meta:settext("foo")
+ end,
+})]]
+
+-- LuaNodeMetadata should support something like this
+--meta.setvar("somevariable", {x=0, y=0, z=0})
+--meta.getvar("somevariable") -> {x=0, y=0, z=0}
--
-- Done, print some random stuff