From: PilzAdam Date: Sat, 9 Mar 2013 20:51:45 +0000 (+0100) Subject: Add lavacooling X-Git-Tag: 0.4.6~23 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0d924e7e4dfe5f1f4e9aa822168e03ae61aaac6a;p=oweals%2Fminetest_game.git Add lavacooling --- diff --git a/mods/default/init.lua b/mods/default/init.lua index 4fe8de6b..1f2c4f7d 100644 --- a/mods/default/init.lua +++ b/mods/default/init.lua @@ -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