Merge pull request #2358 from kacpherek/fix/shulker-closed-armor

🤖 Agent: Proven in union R1 (branch union/cg19-r1, main + 83 of kacpherek's PRs): the 98 harnesses it can affect, clippy -D warnings, tests, lan_e2e in-frame and on the server thread.
This commit is contained in:
Ludovic Marie
2026-10-27 15:08:46 +01:00
committed by GitHub
+8 -2
View File
@@ -1965,9 +1965,15 @@ impl Mob {
amount *= 5.0;
}
let (worn, worn_toughness) = self.worn_armor();
if !source.bypasses_armor() && self.kind.armor + worn > 0.0 {
// Shulker.setRawPeekAmount: a closed shell adds the covered armor modifier.
let covered = if self.species() == Species::Shulker && self.extra.counter == 0 {
20.0
} else {
0.0
};
if !source.bypasses_armor() && self.kind.armor + worn + covered > 0.0 {
// CombatRules.getDamageAfterAbsorb
let armor = self.kind.armor + worn;
let armor = self.kind.armor + worn + covered;
let toughness = 2.0 + (self.kind.armor_toughness + worn_toughness) / 4.0;
let effective = (armor - amount / toughness).clamp(armor * 0.2, 20.0);
let mut fraction = effective / 25.0;