Apply Unbreaking to armor wear from Thorns

Thorns always cost the worn piece 2 durability. Run it through the same
durability loss as other wear so Unbreaking can cancel points.
This commit is contained in:
Kacpherek
2026-10-26 18:45:54 +01:00
parent 2ca383f36d
commit dbef78bcb8
@@ -303,8 +303,10 @@ impl Game<'_> {
continue;
}
hits.push(1.0 + self.world.random.next_float() * 4.0);
// ChangeItemDamage -> ItemStack.hurtAndBreak: unbreaking applies.
let loss = self.durability_loss(&stack, 2);
if let Some(s) = self.armor[slot].as_mut() {
s.damage += 2;
s.damage += loss;
if self
.res
.items()