Skip to content

Work on fixing Any/Not holderset compile errors - #3792

Merged
XFactHD merged 6 commits into
neoforged:port/26.4from
pupnewfster:holdersets
Dec 6, 2026
Merged

XFactHD merged 6 commits into
neoforged:port/26.4from
pupnewfster:holdersets

Conversation

@pupnewfster

@pupnewfster pupnewfster commented Dec 5, 2026 •

Copy link
Copy Markdown
Member

Still needs comments/documentation and testing, and also figuring out the best way to handle patching in a version to PlaceholderLookupProvider$UniversalLookup as that just casts between types so I am unsure the best way to handle it, should we have it just create a delegate instead of cast? Alternatively if we loosen the checks in the codecs and the toString for AnyHolderSet, we could make it so that the AnyHolderSet that is placeholder can just be serialized to anything (as it doesn't actually write any data), though then the error for accessing the "unbound" contents won't be able to reference what registry it is attempted to be for. Though I still think this might be the best solution (and then would lower the overhead of some of the patches for adding support for the unbound one.

I also for now have it so that the holder getter method is non defaulted so that we can find new patch sites easier between ports. I think this makes sense, but I also decided it was cleaner to use HolderSet instead of the more specific AnyHolderSet type for purposes of not having to use FQNs in patches and so that multiloader mods can more easily just default it if they want in their custom getter. But I am wondering if that is worth it for the extra checks/casts needed in the AnyHolderSet codecs

Still needs testing, but in theory this should work to fix the compile errors relating to Any/Not holdersets. I went ahead and made the unbounded any holderset not require knowing the type as it is just for serialization, and then that reduces the number of necessary patches vs just returning a cast version of it. There are a couple TODOs in the AnyHolderSet I added that I am unsure about the best handling of, but we might want to address before merging.

@pupnewfster
pupnewfster requested a review from XFactHD December 5, 2026 17:55
@neoforged-automation neoforged-automation Bot added the 26.4 Targeted at Minecraft 26.4 label Dec 5, 2026
@pupnewfster
pupnewfster marked this pull request as ready for review December 5, 2026 22:50
@pupnewfster
pupnewfster requested a review from XFactHD December 6, 2026 02:07
@XFactHD
XFactHD merged commit 75dfab3 into neoforged:port/26.4 Dec 6, 2026
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

26.4 Targeted at Minecraft 26.4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants