diff --git a/.gitmodules b/.gitmodules index 36b31280..f664db7d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -67,9 +67,6 @@ [submodule "mods/lightning"] path = mods/lightning url = https://github.com/minetest-mods/lightning.git -[submodule "mods/weather_pack"] - path = mods/weather_pack - url = https://github.com/xeranas/weather_pack.git [submodule "mods/moreplants"] path = mods/moreplants url = https://github.com/sys4-fr/moreplants.git @@ -139,3 +136,7 @@ [submodule "mods/cherry_tree"] path = mods/cherry_tree url = https://github.com/sys4-fr/cherry_tree.git +[submodule "mods/weather_pack"] + path = mods/weather_pack + url = https://github.com/sys4-fr/weather_pack.git + branch = nalc diff --git a/mods/snowdrift/README.txt b/mods/snowdrift/README.txt deleted file mode 100644 index a22d2c90..00000000 --- a/mods/snowdrift/README.txt +++ /dev/null @@ -1,11 +0,0 @@ -snowdrift 0.5.1 by paramat -For Minetest 0.4.15 and later -Depends default - -Licenses: -Source code: -MIT by paramat -Media: -Textures CC BY-SA (3.0) by paramat -Sounds CC BY (3.0) by inchadney -http://freesound.org/people/inchadney/sounds/58835/ diff --git a/mods/snowdrift/depends.txt b/mods/snowdrift/depends.txt deleted file mode 100644 index 4ad96d51..00000000 --- a/mods/snowdrift/depends.txt +++ /dev/null @@ -1 +0,0 @@ -default diff --git a/mods/snowdrift/init.lua b/mods/snowdrift/init.lua deleted file mode 100644 index f58c89e9..00000000 --- a/mods/snowdrift/init.lua +++ /dev/null @@ -1,229 +0,0 @@ --- Parameters - -local YLIMIT = 1 -- Set to world's water level or level of lowest open area, - -- calculations are disabled below this y. -local PRECSPR = 6 -- Time scale for precipitation variation in minutes -local PRECOFF = -0.4 -- Precipitation offset, higher = rains more often -local GSCYCLE = 0.5 -- Globalstep cycle (seconds) -local FLAKES = 16 -- Snowflakes per cycle -local DROPS = 64 -- Raindrops per cycle -local RAINGAIN = 0.2 -- Rain sound volume -local COLLIDE = false -- Whether particles collide with nodes -local NISVAL = 39 -- Clouds RGB value at night -local DASVAL = 175 -- Clouds RGB value in daytime - -local np_prec = { - offset = 0, - scale = 1, - spread = {x = PRECSPR, y = PRECSPR, z = PRECSPR}, - seed = 813, - octaves = 1, - persist = 0, - lacunarity = 2.0, - --flags = "" -} - --- These 2 must match biome heat and humidity noise parameters for a world - -local np_temp = { - offset = 50, - scale = 50, - spread = {x = 350, y = 350, z = 350}, - seed = 5349, - octaves = 3, - persist = 0.5, - lacunarity = 2.0, - --flags = "" -} - -local np_humid = { - offset = 50, - scale = 50, - spread = {x = 350, y = 350, z = 350}, - seed = 842, - octaves = 3, - persist = 0.5, - lacunarity = 2.0, - --flags = "" -} - - --- Stuff - -local difsval = DASVAL - NISVAL -local grad = 14 / 95 -local yint = 1496 / 95 - - --- Initialise noise objects to nil - -local nobj_temp = nil -local nobj_humid = nil -local nobj_prec = nil - - --- Globalstep function - -local handles = {} -local timer = 0 - -minetest.register_globalstep(function(dtime) - timer = timer + dtime - if timer < GSCYCLE then - return - end - - timer = 0 - - for _, player in ipairs(minetest.get_connected_players()) do - local player_name = player:get_player_name() - local ppos = player:getpos() - local pposy = math.floor(ppos.y) + 2 -- Precipitation when swimming - if pposy >= YLIMIT then - local pposx = math.floor(ppos.x) - local pposz = math.floor(ppos.z) - local ppos = {x = pposx, y = pposy, z = pposz} - - local nobj_temp = nobj_temp or minetest.get_perlin(np_temp) - local nobj_humid = nobj_humid or minetest.get_perlin(np_humid) - local nobj_prec = nobj_prec or minetest.get_perlin(np_prec) - - local nval_temp = nobj_temp:get2d({x = pposx, y = pposz}) - local nval_humid = nobj_humid:get2d({x = pposx, y = pposz}) - local nval_prec = nobj_prec:get2d({x = os.clock() / 60, y = 0}) - - -- Biome system: Frozen biomes below heat 35, - -- deserts below line 14 * t - 95 * h = -1496 - -- h = (14 * t + 1496) / 95 - -- h = 14/95 * t + 1496/95 - -- where 14/95 is gradient and 1496/95 is y intersection - -- h - 14/95 t = 1496/95 y intersection - -- so area above line is - -- h - 14/95 t > 1496/95 - local freeze = nval_temp < 35 - local precip = nval_prec < (nval_humid - 50) / 50 + PRECOFF and - nval_humid - grad * nval_temp > yint - - -- Check if player is outside - local outside = minetest.get_node_light(ppos, 0.5) == 15 - - -- Occasionally reset player sky - if math.random() < 0.1 then - if precip then - -- Set overcast sky - local sval - local time = minetest.get_timeofday() - if time >= 0.5 then - time = 1 - time - end - -- Sky brightness transitions: - -- First transition (24000 -) 4500, (1 -) 0.1875 - -- Last transition (24000 -) 5750, (1 -) 0.2396 - if time <= 0.1875 then - sval = NISVAL - elseif time >= 0.2396 then - sval = DASVAL - else - sval = math.floor(NISVAL + ((time - 0.1875) / 0.0521) * difsval) - end - - player:set_sky({r = sval, g = sval, b = sval + 16, a = 255}, "plain", {}) - else - -- Reset sky to normal - player:set_sky({}, "regular", {}) - end - end - - if not precip or not outside or freeze then - if handles[player_name] then - -- Stop sound if playing - minetest.sound_stop(handles[player_name]) - handles[player_name] = nil - end - end - - if precip and outside then - -- Precipitation - if freeze then - -- Snowfall - for flake = 1, FLAKES do - minetest.add_particle({ - pos = { - x = pposx - 24 + math.random(0, 47), - y = pposy + 8 + math.random(0, 1), - z = pposz - 20 + math.random(0, 47) - }, - vel = { - x = 0.0, - y = -2.0, - z = -1.0 - }, - acc = {x = 0, y = 0, z = 0}, - expirationtime = 8.5, - size = 2.8, - collisiondetection = COLLIDE, - collision_removal = true, - vertical = false, - texture = "snowdrift_snowflake" .. math.random(1, 4) .. ".png", - playername = player:get_player_name() - }) - end - else - -- Rainfall - for flake = 1, DROPS do - minetest.add_particle({ - pos = { - x = pposx - 8 + math.random(0, 16), - y = pposy + 8 + math.random(0, 5), - z = pposz - 8 + math.random(0, 16) - }, - vel = { - x = 0.0, - y = -10.0, - z = 0.0 - }, - acc = {x = 0, y = 0, z = 0}, - expirationtime = 2.1, - size = 2.8, - collisiondetection = COLLIDE, - collision_removal = true, - vertical = true, - texture = "snowdrift_raindrop.png", - playername = player:get_player_name() - }) - end - - if not handles[player_name] then - -- Start sound if not playing - local handle = minetest.sound_play( - "snowdrift_rain", - { - to_player = player_name, - gain = RAINGAIN, - loop = true, - } - ) - if handle then - handles[player_name] = handle - end - end - end - end - elseif handles[player_name] then - -- Stop sound when player goes under y limit - minetest.sound_stop(handles[player_name]) - handles[player_name] = nil - end - end -end) - - --- Stop sound and remove player handle on leaveplayer - -minetest.register_on_leaveplayer(function(player) - local player_name = player:get_player_name() - if handles[player_name] then - minetest.sound_stop(handles[player_name]) - handles[player_name] = nil - end -end) diff --git a/mods/snowdrift/license.txt b/mods/snowdrift/license.txt deleted file mode 100644 index 180c44a4..00000000 --- a/mods/snowdrift/license.txt +++ /dev/null @@ -1,91 +0,0 @@ -License of source code ----------------------- - -The MIT License (MIT) -Copyright (C) 2017 paramat - -Permission is hereby granted, free of charge, to any person obtaining a copy of this -software and associated documentation files (the "Software"), to deal in the Software -without restriction, including without limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of the Software, and to permit -persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or -substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - -For more details: -https://opensource.org/licenses/MIT - - -License of media (textures) ---------------------------- - -Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) -Copyright (C) 2017 paramat - -You are free to: -Share — copy and redistribute the material in any medium or format. -Adapt — remix, transform, and build upon the material for any purpose, even commercially. -The licensor cannot revoke these freedoms as long as you follow the license terms. - -Under the following terms: - -Attribution — You must give appropriate credit, provide a link to the license, and -indicate if changes were made. You may do so in any reasonable manner, but not in any way -that suggests the licensor endorses you or your use. - -ShareAlike — If you remix, transform, or build upon the material, you must distribute -your contributions under the same license as the original. - -No additional restrictions — You may not apply legal terms or technological measures that -legally restrict others from doing anything the license permits. - -Notices: - -You do not have to comply with the license for elements of the material in the public -domain or where your use is permitted by an applicable exception or limitation. -No warranties are given. The license may not give you all of the permissions necessary -for your intended use. For example, other rights such as publicity, privacy, or moral -rights may limit how you use the material. - -For more details: -http://creativecommons.org/licenses/by-sa/3.0/ - - -License of media (sounds) -------------------------- - -Attribution 3.0 Unported (CC BY 3.0) -Copyright (C) 2008 inchadney - -You are free to: -Share — copy and redistribute the material in any medium or format. -Adapt — remix, transform, and build upon the material for any purpose, even commercially. -The licensor cannot revoke these freedoms as long as you follow the license terms. - -Under the following terms: - -Attribution — You must give appropriate credit, provide a link to the license, and -indicate if changes were made. You may do so in any reasonable manner, but not in any way -that suggests the licensor endorses you or your use. - -No additional restrictions — You may not apply legal terms or technological measures that -legally restrict others from doing anything the license permits. - -Notices: - -You do not have to comply with the license for elements of the material in the public -domain or where your use is permitted by an applicable exception or limitation. -No warranties are given. The license may not give you all of the permissions necessary -for your intended use. For example, other rights such as publicity, privacy, or moral -rights may limit how you use the material. - -For more details: -http://creativecommons.org/licenses/by/3.0/ diff --git a/mods/snowdrift/sounds/snowdrift_rain.ogg b/mods/snowdrift/sounds/snowdrift_rain.ogg deleted file mode 100644 index b86eb5b2..00000000 Binary files a/mods/snowdrift/sounds/snowdrift_rain.ogg and /dev/null differ diff --git a/mods/snowdrift/textures/snowdrift_raindrop.png b/mods/snowdrift/textures/snowdrift_raindrop.png deleted file mode 100644 index 1e4d3ac7..00000000 Binary files a/mods/snowdrift/textures/snowdrift_raindrop.png and /dev/null differ diff --git a/mods/snowdrift/textures/snowdrift_snowflake1.png b/mods/snowdrift/textures/snowdrift_snowflake1.png deleted file mode 100644 index b8d915fe..00000000 Binary files a/mods/snowdrift/textures/snowdrift_snowflake1.png and /dev/null differ diff --git a/mods/snowdrift/textures/snowdrift_snowflake2.png b/mods/snowdrift/textures/snowdrift_snowflake2.png deleted file mode 100644 index ca7cfc24..00000000 Binary files a/mods/snowdrift/textures/snowdrift_snowflake2.png and /dev/null differ diff --git a/mods/snowdrift/textures/snowdrift_snowflake3.png b/mods/snowdrift/textures/snowdrift_snowflake3.png deleted file mode 100644 index 1e961820..00000000 Binary files a/mods/snowdrift/textures/snowdrift_snowflake3.png and /dev/null differ diff --git a/mods/snowdrift/textures/snowdrift_snowflake4.png b/mods/snowdrift/textures/snowdrift_snowflake4.png deleted file mode 100644 index 5fe122c3..00000000 Binary files a/mods/snowdrift/textures/snowdrift_snowflake4.png and /dev/null differ diff --git a/mods/weather_pack b/mods/weather_pack new file mode 160000 index 00000000..e6485ec3 --- /dev/null +++ b/mods/weather_pack @@ -0,0 +1 @@ +Subproject commit e6485ec34dcdbd81aa6768e6e1b2e05f79395314 diff --git a/worlds/minetestforfun/world.mt b/worlds/minetestforfun/world.mt index 422b1e6b..20e68f6f 100644 --- a/worlds/minetestforfun/world.mt +++ b/worlds/minetestforfun/world.mt @@ -280,7 +280,7 @@ load_mod_cotton = true load_mod_camera = true load_mod_claycrafter = true -load_mod_snowdrift = true +load_mod_weather_pack = true load_mod_nyancat = true load_mod_cherry_tree = true