work around bug in lava cooling (WIP)

This commit is contained in:
Nils Dagsson Moskopp 2021-09-04 02:36:49 +02:00
parent 4ca70a7af1
commit cc76a79a7d
No known key found for this signature in database
GPG Key ID: A3BC671C35191080
1 changed files with 23 additions and 0 deletions

View File

@ -108,6 +108,20 @@ S("• When water is directly below lava, the water turns into stone."),
_mcl_hardness = -1,
})
function cool_lava_next_to_water_flow(pos)
local node = minetest.get_node(pos)
if 1 ~= minetest.get_item_group(node.name, "lava") then
return
end
local lavatype = minetest.registered_nodes[node.name].liquidtype
if lavatype == "flowing" then
minetest.set_node(pos, {name="mcl_core:cobble"})
elseif lavatype == "source" then
minetest.set_node(pos, {name="mcl_core:obsidian"})
end
minetest.sound_play("fire_extinguish_flame", {pos = pos, gain = 0.25, max_hear_distance = 16}, true)
end
function flow_water_downwards(pos, node, limit)
if limit == 0 then
return
@ -124,6 +138,15 @@ function flow_water_downwards(pos, node, limit)
param2 = 15,
}
)
local neighbours_pos = {
{x=pos.x+1, y=pos.y, z=pos.z},
{x=pos.x-1, y=pos.y, z=pos.z},
{x=pos.x, y=pos.y, z=pos.z+1},
{x=pos.x, y=pos.y, z=pos.z-1},
}
for _, neighbour_pos in ipairs(neighbours_pos) do
cool_lava_next_to_water_flow(neighbour_pos)
end
local below_pos = {x=pos.x, y=pos.y-1, z=pos.z}
local below_node = minetest.get_node(below_pos)
minetest.after(