Skip to content

fix: placeholder parsing in sound expressions - #565

Merged
Exanthiax merged 4 commits into
masterfrom
fix/play-sound-placeholder-expressions
Aug 7, 2026
Merged

fix: placeholder parsing in sound expressions#565
Exanthiax merged 4 commits into
masterfrom
fix/play-sound-placeholder-expressions

Conversation

@Exanthiax

Copy link
Copy Markdown
Member

No description provided.

Component.unstyled() wrapped every name/lore line in an empty parent
component (color(null), italic false) via append(), so the CUSTOM_NAME
data component ended up as {"text":"","extra":[{"text":"Name"}]}
instead of a flat {"text":"Name"}. Anvil renames (and any other
FastItemStack.displayName/lore write) go through this path, so every
renamed item's custom_name diverged from vanilla's format, breaking
resource packs that key item models off custom_name.

Use decorationIfAbsent(ITALIC, FALSE) directly on the component instead
of wrapping it, which only resets the implicit italic on custom names
without introducing a synthetic parent/child structure.
…placeholder context

AbstractPlayableSound's config deserializer always evaluated pitch/
volume expressions against PlaceholderContext.EMPTY, so any expression
referencing a placeholder (e.g. %libreforge_points_x%) silently
resolved with that placeholder missing, producing a wrong or constant
result regardless of the actual value. Add create(Config,
PlaceholderContext) overloads that thread a real context through
readNumber/readRangePart; the existing no-context create(Config) keeps
using PlaceholderContext.EMPTY for callers that have none.
@Exanthiax
Exanthiax requested a review from a team August 5, 2026 21:22
This leaked in from the anvil PR and is unrelated to sound placeholder
expressions; reviewer flagged it for removal.
@Exanthiax
Exanthiax requested a review from CallumJohnson August 6, 2026 15:57
…eholder-expressions

# Conflicts:
#	eco-api/src/main/java/com/willfp/eco/core/sound/AbstractPlayableSound.java
@Exanthiax
Exanthiax marked this pull request as ready for review August 7, 2026 23:24
@Exanthiax
Exanthiax requested review from 0ft3n and WillFP as code owners August 7, 2026 23:24
@Exanthiax
Exanthiax merged commit 7c8319c into master Aug 7, 2026
1 check passed
@Exanthiax
Exanthiax deleted the fix/play-sound-placeholder-expressions branch August 7, 2026 23:25
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.

2 participants