From 30e543d4d21c6bf379548f3e5866942eacdd0243 Mon Sep 17 00:00:00 2001 From: cora Date: Sun, 19 Jun 2022 22:35:49 +0200 Subject: [PATCH] Add settings to change weather particle amounts --- mods/ENVIRONMENT/mcl_weather/rain.lua | 4 ++-- mods/ENVIRONMENT/mcl_weather/snow.lua | 4 ++-- settingtypes.txt | 9 +++++++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/mods/ENVIRONMENT/mcl_weather/rain.lua b/mods/ENVIRONMENT/mcl_weather/rain.lua index 97e674404..717f2fd52 100644 --- a/mods/ENVIRONMENT/mcl_weather/rain.lua +++ b/mods/ENVIRONMENT/mcl_weather/rain.lua @@ -1,5 +1,5 @@ -local PARTICLES_COUNT_RAIN = 500 -local PARTICLES_COUNT_THUNDER = 900 +local PARTICLES_COUNT_RAIN = tonumber(minetest.settings:get("mcl_weather_rain_particles")) or 500 +local PARTICLES_COUNT_THUNDER = tonumber(minetest.settings:get("mcl_weather_thunder_particles")) or 900 local get_connected_players = minetest.get_connected_players diff --git a/mods/ENVIRONMENT/mcl_weather/snow.lua b/mods/ENVIRONMENT/mcl_weather/snow.lua index cb4c6ba06..f169620dd 100644 --- a/mods/ENVIRONMENT/mcl_weather/snow.lua +++ b/mods/ENVIRONMENT/mcl_weather/snow.lua @@ -2,11 +2,11 @@ local get_connected_players = minetest.get_connected_players mcl_weather.snow = {} -mcl_weather.snow.particles_count = 15 +local PARTICLES_COUNT_SNOW = tonumber(minetest.settings:get("mcl_weather_snow_particles")) or 99 mcl_weather.snow.init_done = false local psdef= { - amount = 99, + amount = PARTICLES_COUNT_SNOW, time = 0, --stay on til we turn it off minpos = vector.new(-25,20,-25), maxpos =vector.new(25,25,25), diff --git a/settingtypes.txt b/settingtypes.txt index 8a0ebcce8..035d56a1c 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -20,6 +20,15 @@ enable_fire (Destructive and spreading fire) bool true # If enabled, the weather will change naturally over time. mcl_doWeatherCycle (Change weather) bool true +# Amount of rain particles. You can reduce this to get better FPS (default: 500) +mcl_weather_rain_particles (Rain particles) int 500 0 + +# Amount of thunder particles. You can reduce this to get better FPS (default: 900) +mcl_weather_thunder_particles (Thunder particles) int 900 0 + +# Amount of snow particles. You can reduce this to get better FPS (default: 100) +mcl_weather_snow_particles (Snow particles) int 100 0 + # If enabled, breaking blocks will cause them to drop as item. # Note that blocks never have drops when in Creative Mode. mcl_doTileDrops (Blocks have drops) bool true