Add lavacooling
authorPilzAdam <pilzadam@minetest.net>
Sat, 9 Mar 2013 20:51:45 +0000 (21:51 +0100)
committerPilzAdam <pilzadam@minetest.net>
Sat, 9 Mar 2013 20:55:01 +0000 (21:55 +0100)
mods/default/init.lua

index 4fe8de6b15b0bf887b72a33af65c43058bde0350..1f2c4f7debe403a8c3151a6cba44664ae3c5a7f5 100644 (file)
@@ -1736,4 +1736,32 @@ function on_punchnode(p, node)
 end
 minetest.register_on_punchnode(on_punchnode)
 
+--
+-- Lavacooling
+--
+
+default.cool_lava_source = function(pos)
+       minetest.env:set_node(pos, {name="default:stone"})
+end
+
+default.cool_lava_flowing = function(pos)
+       minetest.env:set_node(pos, {name="default:cobble"})
+end
+
+minetest.register_abm({
+       nodenames = {"default:lava_flowing"},
+       neighbors = {"group:water"},
+       interval = 1,
+       chance = 1,
+       action = default.cool_lava_flowing,
+})
+
+minetest.register_abm({
+       nodenames = {"default:lava_source"},
+       neighbors = {"group:water"},
+       interval = 1,
+       chance = 1,
+       action = default.cool_lava_source,
+})
+
 -- END