From ca27237ffc9ee61afb15c994a889fb743c99aeed Mon Sep 17 00:00:00 2001 From: cora Date: Sun, 19 Jun 2022 22:19:46 +0200 Subject: [PATCH 1/5] Tweak particle spawner settings --- mods/ENVIRONMENT/mcl_weather/rain.lua | 20 +++++++++----------- mods/ENVIRONMENT/mcl_weather/snow.lua | 6 +++--- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/mods/ENVIRONMENT/mcl_weather/rain.lua b/mods/ENVIRONMENT/mcl_weather/rain.lua index f0be39f6c..039b02dd2 100644 --- a/mods/ENVIRONMENT/mcl_weather/rain.lua +++ b/mods/ENVIRONMENT/mcl_weather/rain.lua @@ -1,5 +1,5 @@ -local PARTICLES_COUNT_RAIN = 800 -local PARTICLES_COUNT_THUNDER = 1200 +local PARTICLES_COUNT_RAIN = 500 +local PARTICLES_COUNT_THUNDER = 900 local get_connected_players = minetest.get_connected_players @@ -20,22 +20,20 @@ mcl_weather.rain = { init_done = false, } local update_sound={} -local vel=math.random(0,3) -local falling_speed=math.random(10,15) -local size = math.random(1,3) + local psdef= { amount = mcl_weather.rain.particles_count, time=0, minpos = vector.new(-15,20,-15), maxpos = vector.new(15,25,15), - minvel = vector.new(-2,-falling_speed-2,-2), - maxvel = vector.new(2,-falling_speed+2,2), + minvel = vector.new(-2,-17,-2), + maxvel = vector.new(2,-8,2), minacc = vector.new(0,0,0), maxacc = vector.new(0,-0.5,0), - minexptime = 15, - maxexptime = 30, - minsize = size, - maxsize= size*2, + minexptime = 1, + maxexptime = 4, + minsize = 4, + maxsize= 8, collisiondetection = true, collision_removal = true, vertical = true, diff --git a/mods/ENVIRONMENT/mcl_weather/snow.lua b/mods/ENVIRONMENT/mcl_weather/snow.lua index a55428996..cb4c6ba06 100644 --- a/mods/ENVIRONMENT/mcl_weather/snow.lua +++ b/mods/ENVIRONMENT/mcl_weather/snow.lua @@ -14,9 +14,9 @@ local psdef= { maxvel = vector.new(0.2,-4,0.2), minacc = vector.new(0,-1,0), maxacc = vector.new(0,-4,0), - minexptime = 15, - maxexptime = 30, - minsize = 0.5, + minexptime = 3, + maxexptime = 5, + minsize = 2, maxsize = 5, collisiondetection = true, collision_removal = true, From d9da50e2926c13502052f765d695db4a8b6a8484 Mon Sep 17 00:00:00 2001 From: cora Date: Sun, 19 Jun 2022 22:25:50 +0200 Subject: [PATCH 2/5] Properly check for sound update (fix warning) --- mods/ENVIRONMENT/mcl_weather/rain.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mods/ENVIRONMENT/mcl_weather/rain.lua b/mods/ENVIRONMENT/mcl_weather/rain.lua index 039b02dd2..97e674404 100644 --- a/mods/ENVIRONMENT/mcl_weather/rain.lua +++ b/mods/ENVIRONMENT/mcl_weather/rain.lua @@ -68,9 +68,10 @@ end -- no no no NO NO f*.. no. no manual particle creatin' PLS!! this sends EVERY particle over the net. function mcl_weather.rain.add_rain_particles(player) mcl_weather.rain.last_rp_count = mcl_weather.rain.particles_count + local l = false for k,v in pairs(textures) do psdef.texture=v - mcl_weather.add_spawner_player(player,"rain"..k,psdef) + l = l or mcl_weather.add_spawner_player(player,"rain"..k,psdef) end if l then update_sound[player:get_player_name()]=true From 30e543d4d21c6bf379548f3e5866942eacdd0243 Mon Sep 17 00:00:00 2001 From: cora Date: Sun, 19 Jun 2022 22:35:49 +0200 Subject: [PATCH 3/5] 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 From dcc7df5f02ebd031d993c04f089a03079a4cb4eb Mon Sep 17 00:00:00 2001 From: cora Date: Mon, 20 Jun 2022 13:31:58 +0200 Subject: [PATCH 4/5] Add setting for nether dust too plus slightly tweak the wording for thunder setting --- mods/ENVIRONMENT/mcl_weather/nether_dust.lua | 4 +++- settingtypes.txt | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/mods/ENVIRONMENT/mcl_weather/nether_dust.lua b/mods/ENVIRONMENT/mcl_weather/nether_dust.lua index a90c8e96e..2a90b2215 100644 --- a/mods/ENVIRONMENT/mcl_weather/nether_dust.lua +++ b/mods/ENVIRONMENT/mcl_weather/nether_dust.lua @@ -1,8 +1,10 @@ mcl_weather.nether_dust = {} mcl_weather.nether_dust.particlespawners = {} +local PARTICLES_COUNT_NETHER_DUST = tonumber(minetest.settings:get("mcl_weather_rain_particles")) or 150 + local psdef= { - amount = 150, + amount = PARTICLES_COUNT_NETHER_DUST, time = 0, minpos = vector.new(-15,-15,-15), maxpos =vector.new(15,15,15), diff --git a/settingtypes.txt b/settingtypes.txt index 035d56a1c..b35e5c7f0 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -23,12 +23,15 @@ 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 thunderstorm rain particles. You can reduce this to get better FPS (default: 900) +mcl_weather_thunder_particles (Thunderstorm rain 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 +# Amount of nether dust particles. You can reduce this to get better FPS (default: 150) +mcl_weather_snow_particles (Nether dust particles) int 150 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 From e3c5b2cbb50012ba7f86207581d085b579f8da67 Mon Sep 17 00:00:00 2001 From: cora Date: Sun, 19 Jun 2022 21:21:49 +0200 Subject: [PATCH 5/5] Fix crash on ghast explosions In certain situations the arrow can be invalidated until its get_pos() is called here - e.g. when the player wears over- enchanted blast protection (65k in this case). This uses the player position for the explosion in these cases --- mods/ENTITIES/mobs_mc/ghast.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mods/ENTITIES/mobs_mc/ghast.lua b/mods/ENTITIES/mobs_mc/ghast.lua index 6e2ea927c..d08b0055c 100644 --- a/mods/ENTITIES/mobs_mc/ghast.lua +++ b/mods/ENTITIES/mobs_mc/ghast.lua @@ -107,7 +107,12 @@ mcl_mobs:register_arrow("mobs_mc:fireball", { full_punch_interval = 1.0, damage_groups = {fleshy = 6}, }, nil) - mcl_mobs:boom(self, self.object:get_pos(), 1, true) + local p = self.object:get_pos() + if p then + mcl_mobs:boom(self, p, 1, true) + else + mcl_mobs:boom(self, player:get_pos(), 1, true) + end end, hit_mob = function(self, mob)