From 095f78b78510cf84c42f6aedef9176f0516f5340 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Fri, 16 Apr 2021 18:34:29 +0200 Subject: [PATCH 1/4] Massive mcl_burning performance improvement --- mods/ENTITIES/mcl_mobs/api.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index a4b7e51326..ac96e33343 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -3447,7 +3447,7 @@ end -- main mob function local mob_step = function(self, dtime) - if not self.fire_resistant then + if not self.fire_resistant and self._mcl_burning_burn_time and self._mcl_burning_burn_time > 0 then mcl_burning.tick(self.object, dtime) end @@ -3906,7 +3906,7 @@ minetest.register_entity(name, { --default built in engine collision detection self.object:set_properties({ collide_with_objects = false, - }) + }) return mob_activate(self, staticdata, def, dtime) end, From 01c79c5a18d335e620777bff8e2d1e485c2337bb Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Fri, 16 Apr 2021 18:37:07 +0200 Subject: [PATCH 2/4] Fix mcl_burning.tick not being called at all for mobs --- mods/ENTITIES/mcl_mobs/api.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ENTITIES/mcl_mobs/api.lua b/mods/ENTITIES/mcl_mobs/api.lua index ac96e33343..9182b11c63 100644 --- a/mods/ENTITIES/mcl_mobs/api.lua +++ b/mods/ENTITIES/mcl_mobs/api.lua @@ -3447,7 +3447,7 @@ end -- main mob function local mob_step = function(self, dtime) - if not self.fire_resistant and self._mcl_burning_burn_time and self._mcl_burning_burn_time > 0 then + if not self.fire_resistant and self.mcl_burning_burn_time and self.mcl_burning_burn_time > 0 then mcl_burning.tick(self.object, dtime) end From 10f81dbf0cfdcf60a9a86888e6ba1ae37e15d752 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Fri, 16 Apr 2021 18:41:10 +0200 Subject: [PATCH 3/4] Change max mcl_bossbars default to 5 (Minecraft value) --- settingtypes.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settingtypes.txt b/settingtypes.txt index bfda9b3ba8..c5968a4c09 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -98,7 +98,7 @@ animated_chests (Animated chests) bool true 3d_player_preview (3D Player preview) bool true # The maximum number of boss bars to simultaniously display on the screen -max_bossbars (Maximum Boss bars) int 4 +max_bossbars (Maximum Boss bars) int 5 [Experimental] # Whether ice is translucent. If disabled, ice is fully opaque. From bd3c08d367fc454aecf9ddd6954d0a81cf2a9514 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Fri, 16 Apr 2021 19:50:56 +0200 Subject: [PATCH 4/4] Improve mcl_burning player performance --- mods/ENTITIES/mcl_burning/init.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mods/ENTITIES/mcl_burning/init.lua b/mods/ENTITIES/mcl_burning/init.lua index 672036c78b..6f1b0ef0d3 100644 --- a/mods/ENTITIES/mcl_burning/init.lua +++ b/mods/ENTITIES/mcl_burning/init.lua @@ -15,7 +15,7 @@ minetest.register_entity("mcl_burning:fire", { pointable = false, glow = -1, }, - + animation_frame = 0, animation_timer = 0, on_step = mcl_burning.fire_entity_step, @@ -23,7 +23,9 @@ minetest.register_entity("mcl_burning:fire", { minetest.register_globalstep(function(dtime) for _, player in pairs(minetest.get_connected_players()) do - mcl_burning.tick(player, dtime) + if player:get_meta():get_float("mcl_burning:burn_time") > 0 then + mcl_burning.tick(player, dtime) + end end end)