Merge pull request #2332 from kacpherek/fix/stations-unbreakable

🤖 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 13:40:16 +01:00
committed by GitHub
+4
View File
@@ -151,8 +151,12 @@ pub struct AnvilResult {
pub repair_item_count_cost: u32,
pub only_renaming: bool,
}
/// `ItemStack.isDamageableItem`: durability, and not `minecraft:unbreakable`.
pub fn is_damageable(items: &Items, stack: &ItemStack) -> bool {
items.get(&stack.item).is_some_and(|i| i.max_damage > 0)
&& stack
.data()
.is_none_or(|d| d.other("minecraft:unbreakable").is_none())
}
fn max_damage(items: &Items, stack: &ItemStack) -> i32 {
items.get(&stack.item).map_or(0, |i| i.max_damage as i32)