From 241a0a82c18b01633c78581d17581ef274780a5c Mon Sep 17 00:00:00 2001 From: Till Affeldt Date: Sat, 18 Apr 2020 08:35:03 +0200 Subject: [PATCH] Add API function to retrieve wind --- lib/environment.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/environment.lua b/lib/environment.lua index 6302595..6fb92c6 100644 --- a/lib/environment.lua +++ b/lib/environment.lua @@ -34,6 +34,12 @@ function environment.get_humidity(pos) return (base + biome * 0.7 + random_base * 0.3) * random end +function environment.get_wind() + local wind_x = climate_mod.state:get_float("wind_x") + local wind_z = climate_mod.state:get_float("wind_z") + return vector.new({ x = wind_x, y = 0, z = wind_z }) +end + function environment.get_weather_presets(player) local pname = player:get_player_name() local weathers = climate_mod.current_weather[pname]