diff --git a/mods/default/functions.lua b/mods/default/functions.lua index 50f481f6..36e6bd7f 100644 --- a/mods/default/functions.lua +++ b/mods/default/functions.lua @@ -345,3 +345,40 @@ minetest.register_abm({ 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 +}) diff --git a/mods/default/textures/default_water_mist.png b/mods/default/textures/default_water_mist.png new file mode 100644 index 00000000..94d8818c Binary files /dev/null and b/mods/default/textures/default_water_mist.png differ