Improve wind position for particles, add command to set wind, improve wind influences

This commit is contained in:
Till Affeldt
2020-04-18 11:12:47 +02:00
parent 241a0a82c1
commit a6cfca7745
8 changed files with 55 additions and 28 deletions

View File

@ -77,6 +77,32 @@ minetest.register_chatcommand("set_humidity", {
end
})
minetest.register_chatcommand("set_wind", {
params = "<wind>",
description = "Override the weather algorithm's windspeed",
privs = { weather = true },
func = function(playername, param)
if param == nil or param == "" then
minetest.chat_send_player(playername, "Provide a number to modify the base humidity")
return
end
local arguments = {}
for w in param:gmatch("%S+") do table.insert(arguments, w) end
local wind_x = arguments[1]
local wind_z = arguments[2]
if wind_x == "auto" then
climate_mod.forced_wind = nil
else
climate_mod.forced_wind = vector.new({
x = tonumber(wind_x),
y = 0,
z = tonumber(wind_z)
})
end
minetest.chat_send_player(playername, "Wind changed")
end
})
minetest.register_chatcommand("weather_settings", {
description = "Print the active Climate API configuration",
func = function(playername)