mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-25 20:11:06 +01:00
Merge pull request 'Implement water freezing (mostly taken from mcla)' (#4478) from WillConker/VoxeLibre:water_freezing into master
Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4478 Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com>
This commit is contained in:
commit
5e366a8916
1 changed files with 16 additions and 0 deletions
|
@ -1451,6 +1451,22 @@ minetest.register_abm({
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Freeze water
|
||||||
|
minetest.register_abm({
|
||||||
|
label = "Freeze water in cold areas",
|
||||||
|
nodenames = {"mcl_core:water_source", "mclx_core:river_water_source"},
|
||||||
|
interval = 32,
|
||||||
|
chance = 8,
|
||||||
|
action = function(pos, node)
|
||||||
|
if mcl_weather.has_snow(pos)
|
||||||
|
and minetest.get_natural_light(vector.offset(pos,0,1,0), 0.5) == minetest.LIGHT_MAX + 1
|
||||||
|
and minetest.get_artificial_light(minetest.get_node(pos).param1) < 10 then
|
||||||
|
node.name = "mcl_core:ice"
|
||||||
|
minetest.swap_node(pos, node)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
--[[ Call this for vines nodes only.
|
--[[ Call this for vines nodes only.
|
||||||
Given the pos and node of a vines node, this returns true if the vines are supported
|
Given the pos and node of a vines node, this returns true if the vines are supported
|
||||||
and false if the vines are currently floating.
|
and false if the vines are currently floating.
|
||||||
|
|
Loading…
Reference in a new issue