Skip to content

[26.2] Fix registry-based conditions in datapack registry and reloadable registry loading - #3451

Merged
sciwhiz12 merged 3 commits into
neoforged:26.2.xfrom
XFactHD:registry_loading_conditions
Sep 11, 2026
Merged

sciwhiz12 merged 3 commits into
neoforged:26.2.xfrom
XFactHD:registry_loading_conditions

Conversation

@XFactHD

@XFactHD XFactHD commented Sep 1, 2026 •

Copy link
Copy Markdown
Member

This PR fixes registry-based loading conditions (neoforge:tag_empty, neoforge:registered) in datapack registry and reloadable registry loading.


Every "layer" of datapack loading (datapack registry, reloadable registry, reload listener) is given access to the contents and tags of all prior layers and static registries. To make this work for tag contents, the condition context must interogate both the "context registries" and the captured "pending tags". This is due to a discrepancy in tag loading between initial load and reload:

  • On initial load only static registry tags are in the "pending tags" while datapack registry tags are bound immediately
  • On reload both static and datapack registry tags are in the "pending tags"

This is however only an issue for introspecting tag contents during loading, the HolderSets for all tags are accessible via the "context registries", they may just not be bound yet.

The test already tries testing for access to tags on reloadable registries but 26.2 does not load tags for reloadable tags, so the non-empty case is excluded and marked as TODO for 26.3 where reloadable registries use the same loading code as datapack registries and therefore have working tags.


I also took the liberty to guard loading condition evaluation, forwarding the error cleanly to the caller instead of letting the exception bubble up into code that is at best capable of handling the GSON exceptions, if any at all.

At the moment, this PR does not pass formatting because I had to use a patch for an access change due to a limitation in JST.

Fixes #3441

@XFactHD XFactHD added bug A bug or error area: data driven This request involves a data driven system area: tags Request related to tags (common or otherwise) 26.2 Targeted at Minecraft 26.2 labels Sep 1, 2026
@neoforged-pr-publishing

Copy link
Copy Markdown
  • Publish PR to GitHub Packages

@sciwhiz12

Copy link
Copy Markdown
Member

JavaSourceTransformer 2.0.11 has been released, which includes neoforged/JavaSourceTransformer#67 for fixing application of anonymous class-affecting AT entries. Based on my previous testing, that fixes the blocking issue here of that access modifier change.

@XFactHD
XFactHD requested a review from sciwhiz12 September 10, 2026 16:52
@XFactHD XFactHD mentioned this pull request Sep 10, 2026
@XFactHD
XFactHD requested a review from pupnewfster September 10, 2026 22:51
@sciwhiz12
sciwhiz12 merged commit c7de8d9 into neoforged:26.2.x Sep 11, 2026
6 checks passed
@neoforged-releases

Copy link
Copy Markdown

🚀 This PR has been released as NeoForge version 26.2.0.87.

@neoforged-automation

Copy link
Copy Markdown
Contributor

Created backport PR: #3511

@neoforged-automation neoforged-automation Bot removed the backport to 26.1.x Add this label to a PR to backport it to 26.1.x label Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

26.2 Targeted at Minecraft 26.2 area: data driven This request involves a data driven system area: tags Request related to tags (common or otherwise) bug A bug or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

neoforge:registered evaluates to false for reloadable registries (loot tables)

3 participants