]> git.lizzy.rs Git - Crafter.git/blob - mods/weather/commands.lua
Fix weird problems with update queueing repeaters and inverters
[Crafter.git] / mods / weather / commands.lua
1 minetest.register_chatcommand("weather", {
2         params = "<mobname>",
3         description = "Spawn a mob",
4         privs = {server = true},
5         func = function( name, weather)
6                 if weather == "0" or weather == "clear" then
7                         weather_type = 0
8                         function_send_weather_type()
9                         update_player_sky()
10                         minetest.chat_send_all(name.." has set the weather to clear!")
11                 elseif weather == "1" or weather == "snow" then
12                         weather_type = 1
13                         function_send_weather_type()
14                         minetest.chat_send_all(name.." has set the weather to snow!")
15                         update_player_sky()
16                 elseif  weather == "2" or weather == "rain" then
17                         weather_type = 2
18                         function_send_weather_type()
19                         update_player_sky()
20                         minetest.chat_send_all(name.." has set the weather to rain!")
21                 elseif weather == "" then
22                         minetest.chat_send_player(name, "Possible weather types are: 0,clear,1,snow,2,rain")
23                 else
24                         minetest.chat_send_player(name, '"'..weather..'"'.." is not a registered weather type!")
25                 end
26         end,
27 })