2013-03-24 14:40:18 +01:00
|
|
|
-- Snow
|
2018-04-29 17:22:05 +02:00
|
|
|
weather_mod.register_downfall("weather:snow",{
|
|
|
|
min_pos = {x=-9, y=7, z=-9},
|
|
|
|
max_pos = {x= 9, y=7, z= 9},
|
|
|
|
falling_speed=5,
|
|
|
|
amount=10,
|
|
|
|
exptime=5,
|
|
|
|
size=25,
|
|
|
|
texture="weather_snow.png"
|
|
|
|
})
|
2013-03-24 14:40:18 +01:00
|
|
|
|
2018-05-12 15:16:26 +02:00
|
|
|
local snow_box =
|
2013-03-24 14:40:18 +01:00
|
|
|
{
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5}
|
|
|
|
}
|
|
|
|
|
|
|
|
-- Snow cover
|
|
|
|
minetest.register_node("weather:snow_cover", {
|
|
|
|
tiles = {"weather_snow_cover.png"},
|
|
|
|
drawtype = "nodebox",
|
|
|
|
paramtype = "light",
|
|
|
|
node_box = snow_box,
|
|
|
|
selection_box = snow_box,
|
|
|
|
groups = {not_in_creative_inventory = 1, crumbly = 3, attached_node = 1},
|
|
|
|
drop = {}
|
|
|
|
})
|
|
|
|
|
2018-05-12 15:16:26 +02:00
|
|
|
--[[ Enable this section if you have a very fast PC
|
2013-03-24 14:40:18 +01:00
|
|
|
minetest.register_abm({
|
|
|
|
nodenames = {"group:crumbly", "group:snappy", "group:cracky", "group:choppy"},
|
|
|
|
neighbors = {"default:air"},
|
2018-04-14 08:07:11 +02:00
|
|
|
interval = 10.0,
|
2013-03-24 14:40:18 +01:00
|
|
|
chance = 80,
|
|
|
|
action = function (pos, node, active_object_count, active_object_count_wider)
|
|
|
|
if weather == "snow" then
|
|
|
|
if minetest.registered_nodes[node.name].drawtype == "normal"
|
|
|
|
or minetest.registered_nodes[node.name].drawtype == "allfaces_optional" then
|
2018-04-13 16:57:11 +02:00
|
|
|
local np = vector.add(pos, {x=0, y=1, z=0})
|
2013-04-21 01:00:08 +02:00
|
|
|
if minetest.env:get_node_light(np, 0.5) == 15
|
|
|
|
and minetest.env:get_node(np).name == "air" then
|
2013-03-24 14:40:18 +01:00
|
|
|
minetest.env:add_node(np, {name="weather:snow_cover"})
|
2018-05-12 15:16:26 +02:00
|
|
|
end
|
2013-03-24 14:40:18 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
})
|
|
|
|
]]
|