From 0b6467d6798c8620db1dee91152feda66087fdfe Mon Sep 17 00:00:00 2001 From: Dieter44 <55900078+Dieter44@users.noreply.github.com> Date: Thu, 11 Nov 2021 16:03:04 +0100 Subject: [PATCH 1/6] Reduce creeper run_velocity to 2.1, to fix #1691 --- mods/ENTITIES/mobs_mc/creeper.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ENTITIES/mobs_mc/creeper.lua b/mods/ENTITIES/mobs_mc/creeper.lua index 999cc5f2d..616e823c8 100644 --- a/mods/ENTITIES/mobs_mc/creeper.lua +++ b/mods/ENTITIES/mobs_mc/creeper.lua @@ -37,7 +37,7 @@ mobs:register_mob("mobs_mc:creeper", { }, makes_footstep_sound = false, walk_velocity = 1.05, - run_velocity = 3.25, + run_velocity = 2.1, runaway_from = { "mobs_mc:ocelot", "mobs_mc:cat" }, attack_type = "explode", eye_height = 1.25, From 68810a2a74ff3dca000234b26c749fb5486d5996 Mon Sep 17 00:00:00 2001 From: Dieter44 <55900078+Dieter44@users.noreply.github.com> Date: Thu, 11 Nov 2021 16:47:32 +0100 Subject: [PATCH 2/6] Change creeper fuse range and defuse range according to minecraft wiki: https://minecraft.fandom.com/wiki/Creeper and: https://minecraft.fandom.com/wiki/Explosion. Fix of #1689 --- mods/ENTITIES/mobs_mc/creeper.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/creeper.lua b/mods/ENTITIES/mobs_mc/creeper.lua index 616e823c8..eb1f108c6 100644 --- a/mods/ENTITIES/mobs_mc/creeper.lua +++ b/mods/ENTITIES/mobs_mc/creeper.lua @@ -47,8 +47,8 @@ mobs:register_mob("mobs_mc:creeper", { --explosion_radius = 3, --explosion_damage_radius = 6, --explosiontimer_reset_radius = 6, - reach = 1.5, - defuse_reach = 4, + reach = 3, + defuse_reach = 5.2, explosion_timer = 0.3, allow_fuse_reset = true, stop_to_explode = true, @@ -186,8 +186,8 @@ mobs:register_mob("mobs_mc:creeper_charged", { --explosion_radius = 3, --explosion_damage_radius = 6, --explosiontimer_reset_radius = 3, - reach = 1.5, - defuse_reach = 4, + reach = 3, + defuse_reach = 10.4, explosion_timer = 0.3, allow_fuse_reset = true, stop_to_explode = true, From 10a5f8c4bfdbfec27fe83ab3c40478e7217c3680 Mon Sep 17 00:00:00 2001 From: Dieter44 <55900078+Dieter44@users.noreply.github.com> Date: Thu, 11 Nov 2021 16:50:29 +0100 Subject: [PATCH 3/6] Adding attribute hostile=true to charged creeper to fix that the charged creeper has no behavior: Issue #1756 --- mods/ENTITIES/mobs_mc/creeper.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/mods/ENTITIES/mobs_mc/creeper.lua b/mods/ENTITIES/mobs_mc/creeper.lua index eb1f108c6..2b66d0f07 100644 --- a/mods/ENTITIES/mobs_mc/creeper.lua +++ b/mods/ENTITIES/mobs_mc/creeper.lua @@ -151,6 +151,7 @@ mobs:register_mob("mobs_mc:creeper_charged", { description = S("Charged Creeper"), type = "monster", spawn_class = "hostile", + hostile = true, hp_min = 20, hp_max = 20, xp_min = 5, From 03d22852ee8a5b203840266f39d302a8854e3cfb Mon Sep 17 00:00:00 2001 From: Dieter44 <55900078+Dieter44@users.noreply.github.com> Date: Thu, 11 Nov 2021 16:56:44 +0100 Subject: [PATCH 4/6] Replace mobs:boom with equivalent mcl_explosions.exlode() to fix game crash when creeper is right-clicked with flint and steel. Issue #1753 --- mods/ENTITIES/mobs_mc/creeper.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mods/ENTITIES/mobs_mc/creeper.lua b/mods/ENTITIES/mobs_mc/creeper.lua index 2b66d0f07..1e23231c1 100644 --- a/mods/ENTITIES/mobs_mc/creeper.lua +++ b/mods/ENTITIES/mobs_mc/creeper.lua @@ -95,7 +95,8 @@ mobs:register_mob("mobs_mc:creeper", { if self._forced_explosion_countdown_timer then self._forced_explosion_countdown_timer = self._forced_explosion_countdown_timer - dtime if self._forced_explosion_countdown_timer <= 0 then - mobs:boom(self, mcl_util.get_object_center(self.object), self.explosion_strength) + local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false + mcl_explosions.explode(mcl_util.get_object_center(self.object), self.explosion_strength, { griefing = mobs_griefing, drop_chance = 1.0}, self.object) end end end, @@ -220,7 +221,8 @@ mobs:register_mob("mobs_mc:creeper_charged", { if self._forced_explosion_countdown_timer then self._forced_explosion_countdown_timer = self._forced_explosion_countdown_timer - dtime if self._forced_explosion_countdown_timer <= 0 then - mobs:boom(self, mcl_util.get_object_center(self.object), self.explosion_strength) + local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false + mcl_explosions.explode(mcl_util.get_object_center(self.object), self.explosion_strength, { griefing = mobs_griefing, drop_chance = 1.0}, self.object) end end end, From 96c4fb60d8641b4181edb902ed24dbf173828d09 Mon Sep 17 00:00:00 2001 From: iliekprogrammar Date: Sat, 13 Nov 2021 10:46:16 +0800 Subject: [PATCH 5/6] Fix crash on startup during immediate runtime by mcl_burning The crash occurs if mcl_burning:data is deserialized to nil. The cause of mcl_burning being set to "return nil" is unknown. Therefore, when it occurs, it will be logged as warning. --- mods/ENTITIES/mcl_burning/init.lua | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/mods/ENTITIES/mcl_burning/init.lua b/mods/ENTITIES/mcl_burning/init.lua index 313e75dca..a47824537 100644 --- a/mods/ENTITIES/mcl_burning/init.lua +++ b/mods/ENTITIES/mcl_burning/init.lua @@ -44,18 +44,18 @@ minetest.register_on_respawnplayer(function(player) mcl_burning.extinguish(player) end) -minetest.register_on_joinplayer(function(player) - local storage - - local burn_data = player:get_meta():get_string("mcl_burning:data") - if burn_data == "" then - storage = {} - else - storage = minetest.deserialize(burn_data) +function mcl_burning.init_player(player) + local meta = player:get_meta() + -- NOTE: mcl_burning:data may be "return nil" (which deserialize into nil) for reasons unknown. + if meta:get_string("mcl_burning:data"):find("return nil", 1, true) then + minetest.log("warning", "[mcl_burning] 'mcl_burning:data' player meta field is invalid! Please report this bug") end - - mcl_burning.storage[player] = storage + mcl_burning.storage[player] = meta:contains("mcl_burning:data") and minetest.deserialize(meta:get_string("mcl_burning:data")) or {} mcl_burning.channels[player] = minetest.mod_channel_join("mcl_burning:" .. player:get_player_name()) +end + +minetest.register_on_joinplayer(function(player) + mcl_burning.init_player(player) end) minetest.register_on_leaveplayer(function(player) From bd1491854369913b8e1373dd5cadcd7280415535 Mon Sep 17 00:00:00 2001 From: iliekprogrammar Date: Sat, 13 Nov 2021 12:12:20 +0800 Subject: [PATCH 6/6] Reduce defuse reach for charged creeper 5.2 is actually half of the estimated MC creeper defuse range, which is 10.4. The reason for this change is to balance the creeper in MCL2 where it fuses whilst moving making it more difficult than MC. In MC, the creeper does not move while fusing. --- mods/ENTITIES/mobs_mc/creeper.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ENTITIES/mobs_mc/creeper.lua b/mods/ENTITIES/mobs_mc/creeper.lua index 1e23231c1..a7e33d1bd 100644 --- a/mods/ENTITIES/mobs_mc/creeper.lua +++ b/mods/ENTITIES/mobs_mc/creeper.lua @@ -189,7 +189,7 @@ mobs:register_mob("mobs_mc:creeper_charged", { --explosion_damage_radius = 6, --explosiontimer_reset_radius = 3, reach = 3, - defuse_reach = 10.4, + defuse_reach = 5.2, explosion_timer = 0.3, allow_fuse_reset = true, stop_to_explode = true,