Add files via upload

master
AiTechEye 2021-02-02 17:30:43 +01:00 committed by GitHub
parent dce7699819
commit 6d30faf135
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 6 deletions

View File

@ -1,9 +1,10 @@
weather.while_rain=function(pos)
for i, w in pairs(weather.currweather) do
if vector.distance(pos,w.pos) <= w.size and w.bio == 1 then
minetest.registered_nodes[minetest.get_node(pos).name].on_rain(pos)
return true
end
end
return false
end
minetest.register_node("weather:woodenbarrel", {
@ -24,15 +25,15 @@ minetest.register_node("weather:woodenbarrel", {
{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
}
},
on_rain=function(pos)
minetest.set_node(pos,{name="weather:woodenbarrel2"})
end,
on_construct=function(pos)
minetest.get_node_timer(pos):start(30)
end,
on_timer = function (pos, elapsed)
weather.while_rain(pos)
return true
if weather.while_rain(pos) then
minetest.set_node(pos,{name="weather:woodenbarrel2"})
else
return true
end
end,
})