diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-11-28 02:16:51 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-11-29 19:13:56 +0200 |
commit | 34bd1b3032963a35b3dcdfb3d1866020002063a1 (patch) | |
tree | 0e401a437c03bb60acc8722e0d8759d29c0cc7cd /data/mods/default | |
parent | 89245885110aeb8ae713ab3dd4aa8caa898a414c (diff) | |
download | minetest-34bd1b3032963a35b3dcdfb3d1866020002063a1.tar.gz minetest-34bd1b3032963a35b3dcdfb3d1866020002063a1.tar.bz2 minetest-34bd1b3032963a35b3dcdfb3d1866020002063a1.zip |
Lua interface for ActiveBlockModifier
Diffstat (limited to 'data/mods/default')
-rw-r--r-- | data/mods/default/init.lua | 41 |
1 files changed, 11 insertions, 30 deletions
diff --git a/data/mods/default/init.lua b/data/mods/default/init.lua index 537f62e31..c59c34fc7 100644 --- a/data/mods/default/init.lua +++ b/data/mods/default/init.lua @@ -1296,36 +1296,6 @@ end register_falling_node("sand", "sand.png") register_falling_node("gravel", "gravel.png") ---[[ -minetest.register_entity("falling_sand", { - -- Definition - collisionbox = {-0.5,-0.5,-0.5, 0.5,0.5,0.5}, - visual = "cube", - textures = {"sand.png","sand.png","sand.png","sand.png","sand.png","sand.png"}, - -- State - fallspeed = 0, - -- Methods - on_step = function(self, dtime) - -- Apply gravity - self.fallspeed = self.fallspeed + dtime * 5 - fp = self.object:getpos() - fp.y = fp.y - self.fallspeed * dtime - self.object:moveto(fp) - -- Turn to actual sand when collides to ground or just move - bcp = {x=fp.x, y=fp.y-0.5, z=fp.z} -- Position of bottom center point - bcn = minetest.env:get_node(bcp) - if bcn.name ~= "air" then - -- Turn to a sand node - np = {x=bcp.x, y=bcp.y+1, z=bcp.z} - minetest.env:add_node(np, {name="sand"}) - self.object:remove() - else - -- Do nothing - end - end -}) ---]] - -- -- Global callbacks -- @@ -1389,6 +1359,17 @@ minetest.register_on_chat_message(function(name, message) end end) +minetest.register_abm({ + nodenames = {"TNT"}, + interval = 10.0, + chance = 1, + action = function(pos, node, active_object_count, active_object_count_wider) + print("TNT ABM action") + pos.y = pos.y + 1 + minetest.env:add_node(pos, {name="papyrus"}) + end, +}) + -- -- Done, print some random stuff -- |