From 23cbc7ad84b012729279afb396e3f24b5440d57e Mon Sep 17 00:00:00 2001 From: sloantothebone Date: Mon, 3 Aug 2015 14:06:12 -0600 Subject: [PATCH 01/14] --- weather/rain.lua | 23 +++++++++++++++++++++++ weather/snow.lua | 9 ++++++--- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/weather/rain.lua b/weather/rain.lua index 4b20da1..d0d5e57 100644 --- a/weather/rain.lua +++ b/weather/rain.lua @@ -22,3 +22,26 @@ minetest.register_globalstep(function(dtime) collisiondetection=false, vertical=true, texture="weather_rain.png", player=player:get_player_name()}) end end) + +-- Might want to comment this section out if you don't have a fast computer +if minetest.get_modpath("waterplus") then +minetest.register_abm({ + nodenames = {"group:crumbly", "group:snappy", "group:cracky", "group:choppy"}, + neighbors = {"default:air"}, + interval = 10.0, + chance = 80, + action = function (pos, node, active_object_count, active_object_count_wider) + if weather == "rain" then + if minetest.registered_nodes[node.name].drawtype == "normal" + or minetest.registered_nodes[node.name].drawtype == "allfaces_optional" then + local np = addvectors(pos, {x=0, y=1, z=0}) + if minetest.env:get_node_light(np, 0.5) == 15 + and minetest.env:get_node(np).name == "air" then + minetest.env:add_node(np, {name="waterplus:finite_1"}) + --minetest.env:add_node(np, {name="default:snow"}) --for carbone :) + end + end + end + end +}) +end diff --git a/weather/snow.lua b/weather/snow.lua index cbd5586..a739a6a 100644 --- a/weather/snow.lua +++ b/weather/snow.lua @@ -51,6 +51,8 @@ minetest.register_node("weather:snow_cover", { drop = {} }) + + --[[ Enable this section if you have a very fast PC minetest.register_abm({ nodenames = {"group:crumbly", "group:snappy", "group:cracky", "group:choppy"}, @@ -64,10 +66,11 @@ minetest.register_abm({ local np = addvectors(pos, {x=0, y=1, z=0}) if minetest.env:get_node_light(np, 0.5) == 15 and minetest.env:get_node(np).name == "air" then - minetest.env:add_node(np, {name="weather:snow_cover"}) + --minetest.env:add_node(np, {name="weather:snow_cover"}) + minetest.env:add_node(np, {name="default:snow"}) end end end end -}) -]] +})]] + From 2ee0846dfa62bba344969f19367efa384ddcbb9d Mon Sep 17 00:00:00 2001 From: sloantothebone Date: Mon, 3 Aug 2015 15:10:28 -0500 Subject: [PATCH 02/14] added depends.txt and waterplus support: drops water when it rains --- weather/depends.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 weather/depends.txt diff --git a/weather/depends.txt b/weather/depends.txt new file mode 100644 index 0000000..4e1241b --- /dev/null +++ b/weather/depends.txt @@ -0,0 +1,2 @@ +default +waterplus? From dfffef123a2d2f9816d0ff325ea1cffd557bb2be Mon Sep 17 00:00:00 2001 From: sloantothebone Date: Mon, 3 Aug 2015 14:44:43 -0600 Subject: [PATCH 03/14] Deleted a comment in rain.lua from snow.lua --- weather/rain.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/weather/rain.lua b/weather/rain.lua index d0d5e57..60a60db 100644 --- a/weather/rain.lua +++ b/weather/rain.lua @@ -38,7 +38,6 @@ minetest.register_abm({ if minetest.env:get_node_light(np, 0.5) == 15 and minetest.env:get_node(np).name == "air" then minetest.env:add_node(np, {name="waterplus:finite_1"}) - --minetest.env:add_node(np, {name="default:snow"}) --for carbone :) end end end From 24cac6f77ba7f25be3111238b1cd4cc58903ae27 Mon Sep 17 00:00:00 2001 From: sloantothebone Date: Mon, 3 Aug 2015 14:52:28 -0600 Subject: [PATCH 04/14] --- README | 1 + 1 file changed, 1 insertion(+) diff --git a/README b/README index d77a4ba..4fd9905 100644 --- a/README +++ b/README @@ -1,4 +1,5 @@ Weather mod for Minetest (http://minetest.net/) +Support for waterplus mod for rain added by sloantothebone License: - Code: LGPL From 690b40000af20346db5b251c424d33e8c865a2c5 Mon Sep 17 00:00:00 2001 From: sloantothebone Date: Mon, 3 Aug 2015 14:54:34 -0600 Subject: [PATCH 05/14] --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 4fd9905..a0e288d 100644 --- a/README +++ b/README @@ -1,5 +1,5 @@ Weather mod for Minetest (http://minetest.net/) -Support for waterplus mod for rain added by sloantothebone +Support for waterplus mod for rain added by sloantothebone. License: - Code: LGPL From 6ff93d4f8fc4f13cd7308b1727d4a6defe2722c3 Mon Sep 17 00:00:00 2001 From: sloantothebone Date: Mon, 3 Aug 2015 14:59:23 -0600 Subject: [PATCH 06/14] made weather:snow_cover the default snow cover while commenting out the code for default:snow, made default an optional dependency --- weather/depends.txt | 2 +- weather/snow.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/weather/depends.txt b/weather/depends.txt index 4e1241b..b9f4c68 100644 --- a/weather/depends.txt +++ b/weather/depends.txt @@ -1,2 +1,2 @@ -default +default? waterplus? diff --git a/weather/snow.lua b/weather/snow.lua index a739a6a..2b8c048 100644 --- a/weather/snow.lua +++ b/weather/snow.lua @@ -66,8 +66,8 @@ minetest.register_abm({ local np = addvectors(pos, {x=0, y=1, z=0}) if minetest.env:get_node_light(np, 0.5) == 15 and minetest.env:get_node(np).name == "air" then - --minetest.env:add_node(np, {name="weather:snow_cover"}) - minetest.env:add_node(np, {name="default:snow"}) + minetest.env:add_node(np, {name="weather:snow_cover"}) + --minetest.env:add_node(np, {name="default:snow"}) end end end From c44efda7dd21f264bfabd07472c52a520cbc42cf Mon Sep 17 00:00:00 2001 From: sloantothebone Date: Mon, 3 Aug 2015 20:02:12 -0600 Subject: [PATCH 07/14] Added .conf, still WIP as indicated by the comments in the code. --- README | 2 +- weather/init.lua | 2 +- weather/rain.lua | 27 +++++++++++++++++++++++++-- weather/snow.lua | 30 +++++++++++++++++++++++++----- 4 files changed, 52 insertions(+), 9 deletions(-) diff --git a/README b/README index a0e288d..4fd9905 100644 --- a/README +++ b/README @@ -1,5 +1,5 @@ Weather mod for Minetest (http://minetest.net/) -Support for waterplus mod for rain added by sloantothebone. +Support for waterplus mod for rain added by sloantothebone License: - Code: LGPL diff --git a/weather/init.lua b/weather/init.lua index 37777d7..e93a3cc 100644 --- a/weather/init.lua +++ b/weather/init.lua @@ -2,7 +2,7 @@ -- * rain -- * snow -- * wind (not implemented) - +print("Lol print works") assert(minetest.add_particlespawner, "I told you to run the latest GitHub!") addvectors = function (v1, v2) diff --git a/weather/rain.lua b/weather/rain.lua index 60a60db..571f2f3 100644 --- a/weather/rain.lua +++ b/weather/rain.lua @@ -1,3 +1,21 @@ +--adding weather.conf +print("Lol print works") +local modpath = minetest.get_modpath(minetest.get_current_modname()) +local worldpath = minetest.get_worldpath() +local input = io.open(modpath.."/weather.conf", "r") +if input then + dofile(modpath.."/weather.conf") + input:close() + input = nil +end +input = io.open(worldpath.."/weather.conf", "r") +if input then + dofile(worldpath.."/weather.conf") + input:close() + input = nil +end + + -- Rain minetest.register_globalstep(function(dtime) if weather ~= "rain" then return end @@ -24,7 +42,8 @@ minetest.register_globalstep(function(dtime) end) -- Might want to comment this section out if you don't have a fast computer -if minetest.get_modpath("waterplus") then +--if RAIN_DROPS then +if RAIN_DROPS and minetest.get_modpath("waterplus") then minetest.register_abm({ nodenames = {"group:crumbly", "group:snappy", "group:cracky", "group:choppy"}, neighbors = {"default:air"}, @@ -37,7 +56,11 @@ minetest.register_abm({ local np = addvectors(pos, {x=0, y=1, z=0}) if minetest.env:get_node_light(np, 0.5) == 15 and minetest.env:get_node(np).name == "air" then - minetest.env:add_node(np, {name="waterplus:finite_1"}) + --if minetest.get_modpath("waterplus") then + --minetest.env:add_node(np, {name="waterplus:finite_1"}) + --else + minetest.env:add_node(np, {name="default:water_flowing"}) + --end end end end diff --git a/weather/snow.lua b/weather/snow.lua index 2b8c048..aec1080 100644 --- a/weather/snow.lua +++ b/weather/snow.lua @@ -1,3 +1,19 @@ +--adding weather.conf +local modpath = minetest.get_modpath(minetest.get_current_modname()) +local worldpath = minetest.get_worldpath() +local input = io.open(modpath.."/weather.conf", "r") +if input then + dofile(modpath.."/weather.conf") + input:close() + input = nil +end +input = io.open(worldpath.."/weather.conf", "r") +if input then + dofile(worldpath.."/weather.conf") + input:close() + input = nil +end + -- Snow minetest.register_globalstep(function(dtime) if weather ~= "snow" then return end @@ -53,7 +69,8 @@ minetest.register_node("weather:snow_cover", { ---[[ Enable this section if you have a very fast PC +-- Enable this section if you have a very fast PC +if SNOW_COVER then minetest.register_abm({ nodenames = {"group:crumbly", "group:snappy", "group:cracky", "group:choppy"}, neighbors = {"default:air"}, @@ -66,11 +83,14 @@ minetest.register_abm({ local np = addvectors(pos, {x=0, y=1, z=0}) if minetest.env:get_node_light(np, 0.5) == 15 and minetest.env:get_node(np).name == "air" then - minetest.env:add_node(np, {name="weather:snow_cover"}) - --minetest.env:add_node(np, {name="default:snow"}) + --if USE_DEFAULT_SNOW then + minetest.env:add_node(np, {name="default:snow"}) + --else + --minetest.env:add_node(np, {name="weather:snow_cover"}) + --end end end end end -})]] - +}) +end From 55fde16523add38588d773cdbb92b223cd4d9244 Mon Sep 17 00:00:00 2001 From: sloantothebone Date: Mon, 3 Aug 2015 20:30:31 -0600 Subject: [PATCH 08/14] Trying to add weather.conf??? --- weather/weather.conf | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 weather/weather.conf diff --git a/weather/weather.conf b/weather/weather.conf new file mode 100644 index 0000000..bb72e9a --- /dev/null +++ b/weather/weather.conf @@ -0,0 +1,15 @@ +--This controls whether the ground is covered with precipitation. +--If the waterplus mod is activated, rain will drop waterplus:finite_1. +--Otherwise, it will use default:water_flowing which will most likely disappear immediately. +--It should look like rain drops soaking into the ground or something. + +--SNOW_COVER activates snow covering the ground when it falls. +--By default the mod uses its own snow, weather:snow_cover so I added the option USE_DEFAULT_SNOW which makes the mod use default:snow. + + +--Edit: I tested it and it really didnt seem to work. At least the default:water_flowing thing. So I commented things out. RAIN_DROPS requires waterplus, and by default SNOW_COVER is default:snow. Go into snow.lua to change it to weather:snow_cover. + +RAIN_DROPS = true + +SNOW_COVER = true +--USE_DEFAULT_SNOW = false From 72a7055241ca1f5ab2943684c7ea3294bffb6bc2 Mon Sep 17 00:00:00 2001 From: sloantothebone Date: Mon, 3 Aug 2015 20:36:15 -0600 Subject: [PATCH 09/14] Added pastebin http://pastebin.com/qYY1xT3j to weather.conf --- weather/weather.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/weather/weather.conf b/weather/weather.conf index bb72e9a..7d7c4a7 100644 --- a/weather/weather.conf +++ b/weather/weather.conf @@ -8,6 +8,7 @@ --Edit: I tested it and it really didnt seem to work. At least the default:water_flowing thing. So I commented things out. RAIN_DROPS requires waterplus, and by default SNOW_COVER is default:snow. Go into snow.lua to change it to weather:snow_cover. +--Here is a pastebin about this issue: http://pastebin.com/qYY1xT3j RAIN_DROPS = true From f57fbafefa28abbbf5521fab0b3acae0601ab77c Mon Sep 17 00:00:00 2001 From: sloantothebone Date: Mon, 3 Aug 2015 20:50:20 -0600 Subject: [PATCH 10/14] Added the pastebin issue into a text file --- What am I doing wrong.txt | 128 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 What am I doing wrong.txt diff --git a/What am I doing wrong.txt b/What am I doing wrong.txt new file mode 100644 index 0000000..1833aa9 --- /dev/null +++ b/What am I doing wrong.txt @@ -0,0 +1,128 @@ +--taken from my own modified version of weather mod, https://github.com/sloantothebone/minetest-mod-weather +--there is no default:water_flowing seen during rain and RAIN_DROPS = true, and weather:snow_cover when SNOW_COVER = true and USE_DEFAULT_SNOW = true + +--config file description of what the code is supposed to do: + +--This controls whether the ground is covered with precipitation. +--If the waterplus mod is activated, rain will drop waterplus:finite_1. +--Otherwise, it will use default:water_flowing which will most likely disappear immediately. +--It should look like rain drops soaking into the ground or something. + +--SNOW_COVER activates snow covering the ground when it falls. +--By default the mod uses its own snow, weather:snow_cover so I added the option USE_DEFAULT_SNOW which makes the mod use default:snow. + + + + +--broken code + +if RAIN_DROPS then +--if RAIN_DROPS and minetest.get_modpath("waterplus") then +minetest.register_abm({ + nodenames = {"group:crumbly", "group:snappy", "group:cracky", "group:choppy"}, + neighbors = {"default:air"}, + interval = 10.0, + chance = 80, + action = function (pos, node, active_object_count, active_object_count_wider) + if weather == "rain" then + if minetest.registered_nodes[node.name].drawtype == "normal" + or minetest.registered_nodes[node.name].drawtype == "allfaces_optional" then + local np = addvectors(pos, {x=0, y=1, z=0}) + if minetest.env:get_node_light(np, 0.5) == 15 + and minetest.env:get_node(np).name == "air" then + if minetest.get_modpath("waterplus") then + minetest.env:add_node(np, {name="waterplus:finite_1"}) + else + minetest.env:add_node(np, {name="default:water_flowing"}) + end + end + end + end + end +}) +end + + +if SNOW_COVER then +minetest.register_abm({ + nodenames = {"group:crumbly", "group:snappy", "group:cracky", "group:choppy"}, + neighbors = {"default:air"}, + interval = 10.0, + chance = 80, + action = function (pos, node, active_object_count, active_object_count_wider) + if weather == "snow" then + if minetest.registered_nodes[node.name].drawtype == "normal" + or minetest.registered_nodes[node.name].drawtype == "allfaces_optional" then + local np = addvectors(pos, {x=0, y=1, z=0}) + if minetest.env:get_node_light(np, 0.5) == 15 + and minetest.env:get_node(np).name == "air" then + if USE_DEFAULT_SNOW then + minetest.env:add_node(np, {name="default:snow"}) + else + minetest.env:add_node(np, {name="weather:snow_cover"}) + end + end + end + end + end +}) +end + + + + + + +--working code + +--if RAIN_DROPS then +if RAIN_DROPS and minetest.get_modpath("waterplus") then +minetest.register_abm({ + nodenames = {"group:crumbly", "group:snappy", "group:cracky", "group:choppy"}, + neighbors = {"default:air"}, + interval = 10.0, + chance = 80, + action = function (pos, node, active_object_count, active_object_count_wider) + if weather == "rain" then + if minetest.registered_nodes[node.name].drawtype == "normal" + or minetest.registered_nodes[node.name].drawtype == "allfaces_optional" then + local np = addvectors(pos, {x=0, y=1, z=0}) + if minetest.env:get_node_light(np, 0.5) == 15 + and minetest.env:get_node(np).name == "air" then + --if minetest.get_modpath("waterplus") then + --minetest.env:add_node(np, {name="waterplus:finite_1"}) + --else + minetest.env:add_node(np, {name="default:water_flowing"}) + --end + end + end + end + end +}) +end + + +if SNOW_COVER then +minetest.register_abm({ + nodenames = {"group:crumbly", "group:snappy", "group:cracky", "group:choppy"}, + neighbors = {"default:air"}, + interval = 10.0, + chance = 80, + action = function (pos, node, active_object_count, active_object_count_wider) + if weather == "snow" then + if minetest.registered_nodes[node.name].drawtype == "normal" + or minetest.registered_nodes[node.name].drawtype == "allfaces_optional" then + local np = addvectors(pos, {x=0, y=1, z=0}) + if minetest.env:get_node_light(np, 0.5) == 15 + and minetest.env:get_node(np).name == "air" then + --if USE_DEFAULT_SNOW then + minetest.env:add_node(np, {name="default:snow"}) + --else + --minetest.env:add_node(np, {name="weather:snow_cover"}) + --end + end + end + end + end +}) +end From 34046a61e5b8bd3094af0b1f9021abb597a7b8f8 Mon Sep 17 00:00:00 2001 From: sloantothebone Date: Mon, 3 Aug 2015 21:03:30 -0600 Subject: [PATCH 11/14] Removed print("Lol print works") --- weather/rain.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weather/rain.lua b/weather/rain.lua index 571f2f3..0622f71 100644 --- a/weather/rain.lua +++ b/weather/rain.lua @@ -1,5 +1,5 @@ --adding weather.conf -print("Lol print works") + local modpath = minetest.get_modpath(minetest.get_current_modname()) local worldpath = minetest.get_worldpath() local input = io.open(modpath.."/weather.conf", "r") From 1454c8bd253c9d1095f998de36c2d5d48955a02d Mon Sep 17 00:00:00 2001 From: sloantothebone Date: Tue, 4 Aug 2015 13:46:20 -0600 Subject: [PATCH 12/14] Changed readme, cleaned up the code a bit. --- README | 1 + weather/rain.lua | 8 ++------ weather/snow.lua | 7 ++----- weather/weather.conf | 16 +++------------- 4 files changed, 8 insertions(+), 24 deletions(-) diff --git a/README b/README index 4fd9905..3171114 100644 --- a/README +++ b/README @@ -1,5 +1,6 @@ Weather mod for Minetest (http://minetest.net/) Support for waterplus mod for rain added by sloantothebone +Also added a config file :D License: - Code: LGPL diff --git a/weather/rain.lua b/weather/rain.lua index 0622f71..2caefac 100644 --- a/weather/rain.lua +++ b/weather/rain.lua @@ -42,7 +42,6 @@ minetest.register_globalstep(function(dtime) end) -- Might want to comment this section out if you don't have a fast computer ---if RAIN_DROPS then if RAIN_DROPS and minetest.get_modpath("waterplus") then minetest.register_abm({ nodenames = {"group:crumbly", "group:snappy", "group:cracky", "group:choppy"}, @@ -56,11 +55,8 @@ minetest.register_abm({ local np = addvectors(pos, {x=0, y=1, z=0}) if minetest.env:get_node_light(np, 0.5) == 15 and minetest.env:get_node(np).name == "air" then - --if minetest.get_modpath("waterplus") then - --minetest.env:add_node(np, {name="waterplus:finite_1"}) - --else - minetest.env:add_node(np, {name="default:water_flowing"}) - --end + minetest.env:add_node(np, {name="waterplus:finite_1"}) + --minetest.env:add_node(np, {name="default:water_flowing"}) end end end diff --git a/weather/snow.lua b/weather/snow.lua index aec1080..de93e7e 100644 --- a/weather/snow.lua +++ b/weather/snow.lua @@ -83,11 +83,8 @@ minetest.register_abm({ local np = addvectors(pos, {x=0, y=1, z=0}) if minetest.env:get_node_light(np, 0.5) == 15 and minetest.env:get_node(np).name == "air" then - --if USE_DEFAULT_SNOW then - minetest.env:add_node(np, {name="default:snow"}) - --else - --minetest.env:add_node(np, {name="weather:snow_cover"}) - --end + minetest.env:add_node(np, {name="default:snow"}) + --minetest.env:add_node(np, {name="weather:snow_cover"}) end end end diff --git a/weather/weather.conf b/weather/weather.conf index 7d7c4a7..67990d8 100644 --- a/weather/weather.conf +++ b/weather/weather.conf @@ -1,16 +1,6 @@ ---This controls whether the ground is covered with precipitation. ---If the waterplus mod is activated, rain will drop waterplus:finite_1. ---Otherwise, it will use default:water_flowing which will most likely disappear immediately. ---It should look like rain drops soaking into the ground or something. - ---SNOW_COVER activates snow covering the ground when it falls. ---By default the mod uses its own snow, weather:snow_cover so I added the option USE_DEFAULT_SNOW which makes the mod use default:snow. - - ---Edit: I tested it and it really didnt seem to work. At least the default:water_flowing thing. So I commented things out. RAIN_DROPS requires waterplus, and by default SNOW_COVER is default:snow. Go into snow.lua to change it to weather:snow_cover. ---Here is a pastebin about this issue: http://pastebin.com/qYY1xT3j +-- This turns on and off stuff that appears on the ground when it rains/snows. Rain requires the waterplus mod, and snow uses a node which is included in the mod but you can change that to default:snow by editing snow.lua. +-- Here is a pastebin about some other features I tried to add to the .conf: http://pastebin.com/qYY1xT3j RAIN_DROPS = true - SNOW_COVER = true ---USE_DEFAULT_SNOW = false + From 36a01e44410dec746c14e403bad6fad7952511b4 Mon Sep 17 00:00:00 2001 From: sloantothebone Date: Tue, 4 Aug 2015 14:52:32 -0500 Subject: [PATCH 14/14] I'm deleting this, its on pastebin --- What am I doing wrong.txt | 128 -------------------------------------- 1 file changed, 128 deletions(-) delete mode 100644 What am I doing wrong.txt diff --git a/What am I doing wrong.txt b/What am I doing wrong.txt deleted file mode 100644 index 1833aa9..0000000 --- a/What am I doing wrong.txt +++ /dev/null @@ -1,128 +0,0 @@ ---taken from my own modified version of weather mod, https://github.com/sloantothebone/minetest-mod-weather ---there is no default:water_flowing seen during rain and RAIN_DROPS = true, and weather:snow_cover when SNOW_COVER = true and USE_DEFAULT_SNOW = true - ---config file description of what the code is supposed to do: - ---This controls whether the ground is covered with precipitation. ---If the waterplus mod is activated, rain will drop waterplus:finite_1. ---Otherwise, it will use default:water_flowing which will most likely disappear immediately. ---It should look like rain drops soaking into the ground or something. - ---SNOW_COVER activates snow covering the ground when it falls. ---By default the mod uses its own snow, weather:snow_cover so I added the option USE_DEFAULT_SNOW which makes the mod use default:snow. - - - - ---broken code - -if RAIN_DROPS then ---if RAIN_DROPS and minetest.get_modpath("waterplus") then -minetest.register_abm({ - nodenames = {"group:crumbly", "group:snappy", "group:cracky", "group:choppy"}, - neighbors = {"default:air"}, - interval = 10.0, - chance = 80, - action = function (pos, node, active_object_count, active_object_count_wider) - if weather == "rain" then - if minetest.registered_nodes[node.name].drawtype == "normal" - or minetest.registered_nodes[node.name].drawtype == "allfaces_optional" then - local np = addvectors(pos, {x=0, y=1, z=0}) - if minetest.env:get_node_light(np, 0.5) == 15 - and minetest.env:get_node(np).name == "air" then - if minetest.get_modpath("waterplus") then - minetest.env:add_node(np, {name="waterplus:finite_1"}) - else - minetest.env:add_node(np, {name="default:water_flowing"}) - end - end - end - end - end -}) -end - - -if SNOW_COVER then -minetest.register_abm({ - nodenames = {"group:crumbly", "group:snappy", "group:cracky", "group:choppy"}, - neighbors = {"default:air"}, - interval = 10.0, - chance = 80, - action = function (pos, node, active_object_count, active_object_count_wider) - if weather == "snow" then - if minetest.registered_nodes[node.name].drawtype == "normal" - or minetest.registered_nodes[node.name].drawtype == "allfaces_optional" then - local np = addvectors(pos, {x=0, y=1, z=0}) - if minetest.env:get_node_light(np, 0.5) == 15 - and minetest.env:get_node(np).name == "air" then - if USE_DEFAULT_SNOW then - minetest.env:add_node(np, {name="default:snow"}) - else - minetest.env:add_node(np, {name="weather:snow_cover"}) - end - end - end - end - end -}) -end - - - - - - ---working code - ---if RAIN_DROPS then -if RAIN_DROPS and minetest.get_modpath("waterplus") then -minetest.register_abm({ - nodenames = {"group:crumbly", "group:snappy", "group:cracky", "group:choppy"}, - neighbors = {"default:air"}, - interval = 10.0, - chance = 80, - action = function (pos, node, active_object_count, active_object_count_wider) - if weather == "rain" then - if minetest.registered_nodes[node.name].drawtype == "normal" - or minetest.registered_nodes[node.name].drawtype == "allfaces_optional" then - local np = addvectors(pos, {x=0, y=1, z=0}) - if minetest.env:get_node_light(np, 0.5) == 15 - and minetest.env:get_node(np).name == "air" then - --if minetest.get_modpath("waterplus") then - --minetest.env:add_node(np, {name="waterplus:finite_1"}) - --else - minetest.env:add_node(np, {name="default:water_flowing"}) - --end - end - end - end - end -}) -end - - -if SNOW_COVER then -minetest.register_abm({ - nodenames = {"group:crumbly", "group:snappy", "group:cracky", "group:choppy"}, - neighbors = {"default:air"}, - interval = 10.0, - chance = 80, - action = function (pos, node, active_object_count, active_object_count_wider) - if weather == "snow" then - if minetest.registered_nodes[node.name].drawtype == "normal" - or minetest.registered_nodes[node.name].drawtype == "allfaces_optional" then - local np = addvectors(pos, {x=0, y=1, z=0}) - if minetest.env:get_node_light(np, 0.5) == 15 - and minetest.env:get_node(np).name == "air" then - --if USE_DEFAULT_SNOW then - minetest.env:add_node(np, {name="default:snow"}) - --else - --minetest.env:add_node(np, {name="weather:snow_cover"}) - --end - end - end - end - end -}) -end