Browse code

Removed weather

Jaidyn Lev authored on 2019-01-06 22:02:30
Showing 8 changed files
1 1
deleted file mode 100644
... ...
@@ -1,9 +0,0 @@
1
-Weather
2
-=====================================================================
3
-Main: Jeija
4
-Lisc: LGPL
5
-Text: 
6
-	Snow cover:	WTFPL
7
-	Rain & snow:	CC-BY-SA 3.0
8
-			By TeddyDesTodes
9
-Link: https://github.com/Jeija/minetest-mod-weather
10 0
deleted file mode 100644
... ...
@@ -1,15 +0,0 @@
1
-minetest.register_privilege("weather", {
2
-	description = "Change the weather",
3
-	give_to_singleplayer = false
4
-})
5
-
6
-minetest.register_chatcommand("setweather", {
7
-	params = "<weather>",
8
-	description = "Set weather to rain, snow or none", -- full description
9
-	privs = {weather = true},
10
-	func = function(name, param)
11
-		weather = param
12
-		save_weather()
13
-	end
14
-})
15 0
deleted file mode 100644
... ...
@@ -1,51 +0,0 @@
1
-
2
-assert(minetest.add_particlespawner, "I told you to run the latest GitHub!")
3
-
4
-addvectors = function (v1, v2)
5
-	return {x=v1.x+v2.x, y=v1.y+v2.y, z=v1.z+v2.z}
6
-end
7
-
8
-save_weather = function ()
9
-	local file = io.open(minetest.get_worldpath().."/weather", "w+")
10
-	file:write(weather)
11
-	file:close()
12
-end
13
-
14
-read_weather = function ()
15
-	local file = io.open(minetest.get_worldpath().."/weather", "r")
16
-	if not file then return end
17
-	local readweather = file:read()
18
-	file:close()
19
-	return readweather
20
-end
21
-
22
-weather = read_weather()
23
-
24
-minetest.register_globalstep(function(dtime)
25
-	if weather == "rain" or weather == "snow" then
26
-		if math.random(1, 10000) == 1 then
27
-			weather = "none"
28
-			ttl = 5
29
-			save_weather()
30
-		end
31
-	else
32
-		if math.random(1, 50000) == 1 then
33
-			weather = "rain"
34
-			save_weather()
35
-		end
36
-		if math.random(1, 50000) == 2 then
37
-			weather = "snow"
38
-			save_weather()
39
-		end
40
-	end
41
-end)
42
-
43
-dofile(minetest.get_modpath("weather").."/rain.lua")
44
-dofile(minetest.get_modpath("weather").."/snow.lua")
45
-dofile(minetest.get_modpath("weather").."/command.lua")
46
-
47
-
48 0
deleted file mode 100644
... ...
@@ -1,38 +0,0 @@
1
-minetest.register_globalstep(function(dtime)
2
-	if weather ~= "rain" then return end
3
-	for _, player in ipairs(minetest.get_connected_players()) do
4
-
5
-
6
-		local ppos = player:get_pos()
7
-
8
-		-- Make sure player is not in a cave/house...
9
-		if minetest.env:get_node_light(ppos, 0.5) ~= 15 then return end
10
-
11
-		-- The actual rain
12
-		local minp = addvectors(ppos, {x=-20, y=7, z=-20})
13
-		local maxp = addvectors(ppos, {x= 20, y=7, z= 20})
14
-
15
-		local vel = {x=0, y=   -4, z=0}
16
-		local acc = {x=0, y=-9.81, z=0}
17
-
18
-		minetest.add_particlespawner({amount=40, time=0.5,
19
-			minpos=minp, maxpos=maxp,
20
-			minvel=vel, maxvel=vel,
21
-			minacc=acc, maxacc=acc,
22
-			minexptime=0.8, maxexptime=0.8,
23
-			minsize=40, maxsize=40,
24
-			collisiondetection=false, vertical=true, texture="weather_rain.png", player=player:get_player_name()})
25
-	end
26
-end)
27 0
deleted file mode 100644
... ...
@@ -1,73 +0,0 @@
1
-minetest.register_globalstep(function(dtime)
2
-	if weather ~= "snow" then return end
3
-	for _, player in ipairs(minetest.get_connected_players()) do
4
-		local ppos = player:getpos()
5
-
6
-		-- Make sure player is not in a cave/house...
7
-		if minetest.env:get_node_light(ppos, 0.5) ~= 15 then return end
8
-
9
-		local minp = addvectors(ppos, {x=-20, y=7, z=-20})
10
-		local maxp = addvectors(ppos, {x= 20, y=7, z= 20})
11
-
12
-		local minp_deep = addvectors(ppos, {x=-10, y=3.2, z=-10})
13
-		local maxp_deep = addvectors(ppos, {x= 10, y=2.6, z= 10})
14
-
15
-		local vel = {x=0, y=   -0.5, z=0}
16
-		local acc = {x=0, y=   -0.5, z=0}
17
-
18
-		minetest.add_particlespawner(5, 0.5,
19
-			minp, maxp,
20
-			vel, vel,
21
-			acc, acc,
22
-			5, 5,
23
-			40, 40,
24
-			false, "weather_snow.png", player:get_player_name())
25
-
26
-		minetest.add_particlespawner(4, 0.5,
27
-			minp_deep, maxp_deep,
28
-			vel, vel,
29
-			acc, acc,
30
-			4, 4,
31
-			40, 40,
32
-			false, "weather_snow.png", player:get_player_name())
33
-	end
34
-end)
35
-
36
-local snow_box =
37
-{
38
-	type  = "fixed",
39
-	fixed = {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5}
40
-}
41
-
42
-minetest.register_node("weather:snow_cover", {
43
-	tiles = {"weather_snow_cover.png"},
44
-	drawtype = "nodebox",
45
-	paramtype = "light",
46
-	node_box = snow_box,
47
-	selection_box = snow_box,
48
-	groups = {not_in_creative_inventory = 1, crumbly = 3, attached_node = 1},
49
-	drop = {}
50
-})
51
-
52
-minetest.register_abm({
53
-	nodenames = {"group:crumbly", "group:snappy", "group:cracky", "group:choppy"},
54
-	neighbors = {"default:air"},
55
-	interval = 10.0, 
56
-	chance = 80,
57
-	action = function (pos, node, active_object_count, active_object_count_wider)
58
-		if weather == "snow" then
59
-			if minetest.registered_nodes[node.name].drawtype == "normal"
60
-			or minetest.registered_nodes[node.name].drawtype == "allfaces_optional" then
61
-				local np = addvectors(pos, {x=0, y=1, z=0})
62
-				if minetest.env:get_node_light(np, 0.5) == 15
63
-				and minetest.env:get_node(np).name == "air" then
64
-					minetest.env:add_node(np, {name="weather:snow_cover"})
65
-				end
66
-			end
67
-		end
68
-	end
69
-})
70
-]]
71 0
deleted file mode 100644
72 1
Binary files a/mods/weather/weather/textures/weather_rain.png and /dev/null differ
73 2
deleted file mode 100644
74 3
Binary files a/mods/weather/weather/textures/weather_snow.png and /dev/null differ
75 4
deleted file mode 100644
76 5
Binary files a/mods/weather/weather/textures/weather_snow_cover.png and /dev/null differ