From aa4f8ba6ccac8821dbf0ea48d4d0aca0f4d89941 Mon Sep 17 00:00:00 2001 From: Eliy21 Date: Sun, 21 Jan 2024 09:17:15 +0000 Subject: [PATCH] Add medium size mob distinction in the cactus mob damage area reach code --- mods/ENTITIES/mcl_mobs/physics.lua | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/physics.lua b/mods/ENTITIES/mcl_mobs/physics.lua index 071e96631..705b22dbb 100644 --- a/mods/ENTITIES/mcl_mobs/physics.lua +++ b/mods/ENTITIES/mcl_mobs/physics.lua @@ -771,10 +771,16 @@ function mob_class:do_env_damage() local dist = vector.distance(pos, near) local dist_feet = vector.distance({x=pos.x, y=pos.y-1, z=pos.z}, near) local large_mob = false + local medium_mob = false if self.name == "mobs_mc:ender_dragon" or self.name == "mobs_mc:ghast" or self.name == "mobs_mc:guardian_elder" or - self.name == "mobs_mc:hoglin" or + self.name == "mobs_mc:slime_big" or + self.name == "mobs_mc:magma_cube_big" or + self.name == "mobs_mc:wither" then + + large_mob = true + elseif self.name == "mobs_mc:hoglin" or self.name == "mobs_mc:zoglin" or self.name == "mobs_mc:horse" or self.name == "mobs_mc:skeleton_horse" or @@ -783,16 +789,13 @@ function mob_class:do_env_damage() self.name == "mobs_mc:mule" or self.name == "mobs_mc:iron_golem" or self.name == "mobs_mc:polar_bear" or - self.name == "mobs_mc:slime_big" or - self.name == "mobs_mc:magma_cube_big" or self.name == "mobs_mc:spider" or self.name == "mobs_mc:cave_spider" or - self.name == "mobs_mc:strider" or - self.name == "mobs_mc:wither" then + self.name == "mobs_mc:strider" then - large_mob = true + medium_mob = true end - if (not large_mob and (dist < 1.03 or dist_feet < 1.6)) or (large_mob and (1.25 or dist_feet < 1.9)) then + if (not large_mob and not medium_mob and (dist < 1.03 or dist_feet < 1.6)) or (medium_mob and (dist < 1.165 or dist_feet < 1.73)) or (large_mob and (dist < 1.25 or dist_feet < 1.9)) then if self.health ~= 0 then self:damage_mob("cactus", 2)