1
0
mirror of https://gitlab.com/rautars/weather_pack.git synced 2025-07-16 13:50:21 +02:00

start using happy_weather_api, fix #8 sky reseting issue

This commit is contained in:
Arturas Norkus
2017-05-22 13:40:16 +03:00
parent dcde7bdd2d
commit 9ec1790b16
30 changed files with 1420 additions and 680 deletions

36
commands.lua Normal file
View File

@ -0,0 +1,36 @@
------------------------------------
-- Happy Weather API Chat Commands
-- License: MIT
-- Credits: xeranas
------------------------------------
minetest.register_privilege("weather_manager", {
description = "Gives ability to control weather",
give_to_singleplayer = false
})
minetest.register_chatcommand("start_weather", {
params = "<weather_cd>",
description = "Starts weather by given weather code.",
privs = {weather_manager = true},
func = function(name, param)
if param ~= nil then
happy_weather.request_to_start(param)
minetest.log("action", name .. " requested weather '" .. param .. "' from chat command")
end
end
})
minetest.register_chatcommand("stop_weather", {
params = "<weather_cd>",
description = "Ends weather by given weather code.",
privs = {weather_manager = true},
func = function(name, param)
if param ~= nil then
happy_weather.request_to_end(param)
minetest.log("action", name .. " requested weather '" .. param .. "' ending from chat command")
end
end
})