Repository navigation
Name mage weapons after their core's material - #60
Conversation
Crafted mage weapons kept the template's plain white name ("Mage Staff",
"Mage Wand", "Mage Blade"), while AdvancedCrafting weapons and armour are
named and coloured after their majority material. Magic never wrote the
MMOItems name.
The core now names the weapon, since it already picks the model. A core's
optional `material:` (e.g. "#d8d8d8Iron") fills `%material%` in the
archetype's new `item-name:` (e.g. "%material% Mage Staff"), and the whole
name takes the material's colour. A core without `material:` falls back to
its name minus "Magical Core"; an archetype without `item-name:` uses
"%material% <name>". The name is written to the MMOItems data and its
original, as AdvancedCrafting does, so MMOItems updates keep it.
Crafting, socket rewrites, refreshes and the station preview all use it.
The name Magic wrote is kept in `magic:gear_name`, so the join/chest-open
refresh renames weapons crafted before this once, keeping their runes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@coderabbitai review |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Summary
Merge Risk: ⚪ Minimal · up to
|
✅ Action performedReview finished.
|
|
Docs: TF-Minecraft/Docs#305 |
Crafted mage weapons kept their template's plain white name ("Mage Staff", "Mage Wand", "Mage Blade"). AdvancedCrafting weapons and armour are named and coloured after their majority material. Magic never wrote the MMOItems name:
GearItemBuilderonly set sockets and stats, andGearModelResolveronly swapped the model.The core now names the weapon, since it already picks the model:
material:ingear/parts.yml(e.g."#d8d8d8Iron") fills%material%in the archetype's newitem-name:ingear/archetypes.yml(e.g."%material% Mage Staff"). The whole name takes the material's colour, as in AdvancedCrafting.material:falls back to its name minus "Magical Core". An archetype withoutitem-name:uses"%material% <name>". A core that gives no material leaves the template name alone.GearName.writesets the MMOItems name and the original in its stat history, the way AdvancedCrafting does, so MMOItems updates keep it./magic weapon give), refreshes and the station preview all use it.magic:gear_name. The join/chest-open refresh renames weapons crafted before this once, through the existing rebuild path that keeps runes and skins. Neither key changes part or archetype revisions.Bundled configs now set
material:on all 12 cores anditem-name:on the three archetypes. Existing servers keep their config files, so the keys have to be added by hand; without them, names fall back to "Iron Staff" style.Tests:
GearNameCoverageTestcovers every new branch, plus crafting, socket rewrite and refresh naming.mvn -B verifyon Linux: 653 tests, 0 failures, coverage gate met. (The gear file tests can't run on Windows because of directory fsync.)material:, to cover the fallback). All four showed white "Mage …" names.magic weapon givecame out as "Iron Mage Wand".tfmc:magic_crafting_station, the assembly preview showed "Iron Mage Staff", and the crafted weapon on the station carries the name andmagic:gear_name.🤖 Generated with Claude Code