Skip to content

fix: update attribute handling to support new key formats#297

Open
Exanthiax wants to merge 1 commit into
masterfrom
fix/attribute_persistance
Open

fix: update attribute handling to support new key formats#297
Exanthiax wants to merge 1 commit into
masterfrom
fix/attribute_persistance

Conversation

@Exanthiax
Copy link
Copy Markdown
Member

fixAttributes() runs on join/quit as a safety net to strip stale libreforge attribute modifiers off the player.

Old code matched by name (mod.name.startsWith("libreforge")), but modifiers are created with only a NamespacedKey — no name string — so getName() never returned "libreforge:...". Safety net never fired. Stale modifiers (e.g. +6 HP from a removed talisman) survived forever.

New code matches by key (key.namespace == "eco" && key.key.startsWith("lf_")). Reliable. Also catches old-format keys (\d+_\d+) for backward compat.

Identifers.kt adds the lf_ prefix so future modifiers are unambiguously identifiable as libreforge-owned.

@Exanthiax Exanthiax requested a review from a team May 17, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant