mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-06-04 21:10:04 -04:00
Added water mist to enhance waterfalls and other water features.
This commit is contained in:
parent
1cc8300ba9
commit
bb51be32a8
2 changed files with 37 additions and 0 deletions
|
@ -346,3 +346,40 @@ minetest.register_abm({
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Water mist
|
||||||
|
--
|
||||||
|
|
||||||
|
minetest.register_abm({
|
||||||
|
nodenames = {"default:water_flowing"},
|
||||||
|
neighbors = {"default:water_source"},
|
||||||
|
interval = 5,
|
||||||
|
chance = 1,
|
||||||
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
|
local posa = {x=pos.x, y=pos.y+1, z=pos.z}
|
||||||
|
local posu = {x=pos.x, y=pos.y-1, z=pos.z}
|
||||||
|
local na = minetest.get_node(posa).name
|
||||||
|
local nu = minetest.get_node(posu).name
|
||||||
|
if na == "default:water_flowing" then
|
||||||
|
if nu == "default:water_source" then
|
||||||
|
minetest.add_particlespawner({
|
||||||
|
amount = 100,
|
||||||
|
time = 6,
|
||||||
|
minpos = {x=pos.x-0.5,y=pos.y,z=pos.z-0.5},
|
||||||
|
maxpos = {x=pos.x+0.5,y=pos.y+0.3,z=pos.z+0.5},
|
||||||
|
minvel = {x=-0.6, y=0.3, z=-0.6},
|
||||||
|
maxvel = {x=0.6, y=0.6, z=0.6},
|
||||||
|
minacc = {x=0, y=-0.1, z=0},
|
||||||
|
maxacc = {x=-0.3, y=-0.3, z=-0.3},
|
||||||
|
minexptime = 2,
|
||||||
|
maxexptime = 2,
|
||||||
|
minsize = 5,
|
||||||
|
maxsize = 9,
|
||||||
|
collisiondetection = true,
|
||||||
|
vertical = false,
|
||||||
|
texture = "default_water_mist.png",
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
BIN
mods/default/textures/default_water_mist.png
Normal file
BIN
mods/default/textures/default_water_mist.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 531 B |
Loading…
Add table
Reference in a new issue