Made lava rewewable, fixed lava cooling.
This commit is contained in:
parent
7b5e0cbede
commit
4daabe0598
@ -131,11 +131,27 @@ minetest.register_on_punchnode(on_punchnode)
|
||||
--
|
||||
|
||||
default.cool_lava_source = function(pos)
|
||||
minetest.set_node(pos, {name="default:obsidian"})
|
||||
if default.search_nearby_nodes(pos,"default:water_source")
|
||||
or default.search_nearby_nodes(pos,"default:water_flowing") then
|
||||
minetest.env:set_node(pos, {name="default:obsidian"})
|
||||
end
|
||||
end
|
||||
|
||||
default.cool_lava_flowing = function(pos)
|
||||
minetest.set_node(pos, {name="default:stone"})
|
||||
if default.search_nearby_nodes(pos,"default:water_source")
|
||||
or default.search_nearby_nodes(pos,"default:water_flowing") then
|
||||
minetest.env:set_node(pos, {name="default:stone"})
|
||||
end
|
||||
end
|
||||
|
||||
default.search_nearby_nodes = function(pos, node)
|
||||
if minetest.env:get_node({x=pos.x-1, y=pos.y, z=pos.z}).name == node then return true end
|
||||
if minetest.env:get_node({x=pos.x+1, y=pos.y, z=pos.z}).name == node then return true end
|
||||
if minetest.env:get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == node then return true end
|
||||
if minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z}).name == node then return true end
|
||||
if minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z-1}).name == node then return true end
|
||||
if minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z+1}).name == node then return true end
|
||||
return false
|
||||
end
|
||||
|
||||
minetest.register_abm({
|
||||
@ -145,7 +161,7 @@ minetest.register_abm({
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
default.cool_lava_flowing(pos, node, active_object_count, active_object_count_wider)
|
||||
end,
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
@ -155,7 +171,7 @@ minetest.register_abm({
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
default.cool_lava_source(pos, node, active_object_count, active_object_count_wider)
|
||||
end,
|
||||
end,
|
||||
})
|
||||
|
||||
--
|
||||
|
@ -530,7 +530,6 @@ minetest.register_node("default:lava_source", {
|
||||
liquid_alternative_flowing = "default:lava_flowing",
|
||||
liquid_alternative_source = "default:lava_source",
|
||||
liquid_viscosity = LAVA_VISC,
|
||||
liquid_renewable = false,
|
||||
damage_per_second = 4*2,
|
||||
post_effect_color = {a=192, r=255, g=64, b=0},
|
||||
groups = {lava=3, liquid=2, hot=3, igniter=1},
|
||||
|
Loading…
x
Reference in New Issue
Block a user