…erial
A crafted helmet moved from a hat look (vanilla bar sized to its MMOItems
durability, e.g. 187 of 1003) to a leather armour skin kept the 187 damage
against leather's bar of 55, so it read 0/55 and could not be worn.
- afterAppearanceChange now drops the bar a hat look added and maps the
MMOItems durability onto the new material's bar, as MMOItems does
- FalseBreakRepair (item scan) fixes pieces that already read broken
while MMOItems durability is left
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem
A crafted helmet that had a hat look (carved pumpkin, head or skull) and was then given a leather armour skin showed
Durability: 0 / 55in the vanilla tooltip and could not be worn, although its MMOItems durability was fine (816 / 1003 on Main, reported by a player on 2026-11-06).Hat looks get their own vanilla bar sized to the MMOItems durability (
CosmeticHelmetFix), so the helmet haddamage187 ofmax_damage1003. The skin changed the material toleather_helmetand only re-profiled the bar when the new material was also a hat. The 187 damage stayed; once the 1003 bar was gone (the player's saved item had none), it counted against leather's 55 and read as broken.Change
CosmeticHelmetFix.afterAppearanceChange: when the new material is not a hat, drop the bar a hat look added (max_damageequal to the MMOItems max, coming from a hat material) and map the MMOItems durability onto the new material's bar the way MMOItems does (SkinnedArmorDurability.vanillaDamage, one-point tolerance). Items withoutMMOITEMS_MAX_DURABILITY(mage weapons wear the vanilla bar itself) are not touched.FalseBreakRepair(item scan handler, subscribed inTLibs.onEnable): a piece whose vanilla bar is at or past its end while MMOItems durability is left gets its bar put back in line. This fixes pieces already broken this way (e.g. the reported helmet) without a reskin. It only matches that state, so other items are skipped until they change.MMOItems durability, skins, names and tags are not changed.
Testing
mvn verify: 264 tests, 0 failures, line coverage gate clean. New tests inCosmeticHelmetTestcover the hat-to-leather rescale (816/1003 gives 10 damage of 55), reskinning an already broken piece, bars a hat did not add, items without MMOItems durability, undamageable materials, the false-break check and repair (including one point past the end), and the scan handler for inventories and pickups.TestChar1as Spellblade): crafted Medium Steel helmet at 814/1000, Kettle Helm hat, then the first Player Armor skin through the/armourshopGUI.max_damage) stays at 0/55.max_damage; the saved-state item is repaired to 45/55 by the scan within half a second. MMOItems durability stays 814.🤖 Generated with Claude Code