2020-04-18 08:01:36 +02:00
|
|
|
climate_api.register_influence("heat", function(pos)
|
|
|
|
return climate_api.environment.get_heat(pos)
|
2020-04-14 11:25:00 +02:00
|
|
|
end)
|
|
|
|
|
2020-04-18 08:01:36 +02:00
|
|
|
climate_api.register_influence("humidity", function(pos)
|
|
|
|
return climate_api.environment.get_humidity(pos)
|
2020-04-14 11:25:00 +02:00
|
|
|
end)
|
|
|
|
|
2020-04-18 08:01:36 +02:00
|
|
|
climate_api.register_influence("biome", function(pos)
|
|
|
|
local data = minetest.get_biome_data(pos)
|
|
|
|
local biome = minetest.get_biome_name(data.biome)
|
|
|
|
return biome
|
|
|
|
end)
|
|
|
|
|
|
|
|
climate_api.register_influence("windspeed", function(_)
|
2020-04-14 11:25:00 +02:00
|
|
|
local wind_x = climate_mod.state:get_float("wind_x")
|
|
|
|
local wind_z = climate_mod.state:get_float("wind_z")
|
|
|
|
return vector.length({x = wind_x, y = 0, z = wind_z})
|
|
|
|
end)
|
|
|
|
|
2020-04-18 08:01:36 +02:00
|
|
|
climate_api.register_influence("wind_x", function(_)
|
2020-04-14 11:25:00 +02:00
|
|
|
return climate_mod.state:get_float("wind_x")
|
|
|
|
end)
|
|
|
|
|
2020-04-18 08:01:36 +02:00
|
|
|
climate_api.register_influence("wind_z", function(_)
|
2020-04-14 11:25:00 +02:00
|
|
|
return climate_mod.state:get_float("wind_z")
|
|
|
|
end)
|
|
|
|
|
2020-04-18 08:01:36 +02:00
|
|
|
climate_api.register_influence("height", function(pos)
|
|
|
|
return pos.y
|
|
|
|
end)
|
|
|
|
|
|
|
|
climate_api.register_influence("light", function(pos)
|
|
|
|
return minetest.env:get_node_light(pos)
|
|
|
|
end)
|
|
|
|
|
|
|
|
climate_api.register_influence("daylight", function(pos)
|
|
|
|
return minetest.env:get_node_light(pos, 0.5)
|
2020-04-14 11:25:00 +02:00
|
|
|
end)
|
|
|
|
|
2020-04-18 08:01:36 +02:00
|
|
|
climate_api.register_influence("time", function(_)
|
|
|
|
return minetest.get_timeofday()
|
2020-04-14 11:25:00 +02:00
|
|
|
end)
|