Skip to content

fix: list as root #491 - #494

Merged
vberlier merged 3 commits into
mcbeet:mainfrom
edayot:mecha_list
Jan 17, 2026
Merged

fix: list as root #491#494
vberlier merged 3 commits into
mcbeet:mainfrom
edayot:mecha_list

Conversation

@edayot

@edayot edayot commented Jan 17, 2026

Copy link
Copy Markdown
Contributor

Adding a new parser to allow list type as root of inline predicate and inline item modifiers.

Fixes #491

@edayot
edayot marked this pull request as ready for review January 17, 2026 16:33
Comment thread packages/mecha/src/mecha/parse.py Outdated
[delegate("resource_location"), delegate("nbt_compound")]
),
"resource_location_or_nbt_list": AlternativeParser(
[delegate("resource_location_or_nbt"), delegate("nbt")]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels pretty ugly doing it this way. And I'm pretty sure this would also allow other NBT types like numeric values.

@vberlier

Copy link
Copy Markdown
Member

Could you add NbtListParser (see NbtCompoundParser), register it as nbt_list, then use delegate("nbt_list")?

Comment thread packages/mecha/src/mecha/parse.py Outdated
Comment thread packages/mecha/src/mecha/parse.py Outdated
Comment thread packages/mecha/src/mecha/parse.py
@vberlier
vberlier merged commit 1cb3a81 into mcbeet:main Jan 17, 2026
2 checks passed
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.

mecha: [] not supported with nested resources

3 participants