From bb51be32a8674e5931a043ef11d743144db7378b Mon Sep 17 00:00:00 2001 From: Ginger Pollard Date: Fri, 11 Sep 2015 19:12:06 -0400 Subject: [PATCH] Added water mist to enhance waterfalls and other water features. --- mods/default/functions.lua | 37 +++++++++++++++++++ mods/default/textures/default_water_mist.png | Bin 0 -> 531 bytes 2 files changed, 37 insertions(+) create mode 100644 mods/default/textures/default_water_mist.png diff --git a/mods/default/functions.lua b/mods/default/functions.lua index 3accbd1f..7b81aaa6 100644 --- a/mods/default/functions.lua +++ b/mods/default/functions.lua @@ -346,3 +346,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 0000000000000000000000000000000000000000..94d8818c0c17661a009db1d8f53d8c97ab57b437 GIT binary patch literal 531 zcmV+u0_^>XP)5ajXG&VsR#NQt(yY?3|=JqW3L9txeQ{4-4rmV(WQ?U;OL^lL(Z7i z<;g9cgV2h^Ln{H@#xq(e`*^IN=cHU9DUaN6WLX|E`ERX)-WrzMQj@IrO!aL%W7Ywj z+6$CA0GUUbOQ{X5hfGhf0F>U`Nr71mNLOfWNpKhmOsZY`otuw-UTaoQ&$OC7>v)S> z*3~+y>8eDV_Z~DXkR}6Bv|Lud9-jaJ@cuT2wCc3*8dhy7R;ko3ur`+T%JYE+71fj> zqVJ-NBEe1TLJWd8*U=*)O53GVpcP)L5thiZ#i_K2#*1Qx9cI|8)O+8S?BUZobZFP; zw%mOzx7xAg?Hb)R<%c4)K9ZYS-LB_Ip1zob$Ejo|J?viKfn?fS*f? literal 0 HcmV?d00001