Fix accessor redirects, patch priority sorting, and CreativeModeTab coremod descriptor - #2297
Merged
Merged
Conversation
Su5eD
approved these changes
Aug 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Issue
This PR addresses three distinct bugs in the transformer and coremod pipeline:
AccessorRedirectTransformer): InAccessorRedirectTransformer,this.methodRenameswas assigned an immutable snapshot (Map.copyOf(methodRenames)) at construction time before any patches were registered or transformed. Because the transform lambda populated the local map instance after construction,this.methodRenamesremained empty at all times during class processing. Consequently, call sites for redirected accessors were never renamed to their prefixed names (connector$redirect$...), resulting in runtimeNoSuchMethodErrorcrashes.PatchRegistrarImpl):PatchRegistrarImpl.getSortedPatches()sorted patch registrations using natural (ascending) order by priority value (Comparator.comparingInt(Registration::priority)). SincePatchRegistrardefinesHIGHEST_SYSTEM_PRIORITY = 1000andLOWEST_SYSTEM_PRIORITY = -1000, highest-priority patches (includingBuiltinConnectorPluginpriority patches) were being applied last instead of first.ConnectorClassProcessor): The syntheticCreativeModeTabconstructor injection inConnectorClassProcessorwas still usingLnet/minecraft/resources/ResourceLocation;in itsGETSTATICinstruction and constructor signature descriptor instead ofLnet/minecraft/resources/Identifier;, causingNoSuchFieldErrorandNoSuchMethodErrorin 26.1+.The Proposal
AccessorRedirectTransformer.java: MademethodRenamesa directConcurrentHashMapfield on the transformer and removed the prematureMap.copyOfsnapshot in the constructor. The transform lambda now populatesthis.methodRenamesdirectly, ensuring method renames persist and are applied duringprocess(ClassNode).PatchRegistrarImpl.java: Inverted the priority comparator ingetSortedPatches()usingComparator.comparingInt(Registration::priority).reversed()so higher integer priorities execute first.ConnectorClassProcessor.java: Replaced allLnet/minecraft/resources/ResourceLocation;descriptors in theCreativeModeTabconstructor injection withLnet/minecraft/resources/Identifier;.Possible Side Effects
Alternatives
PatchRegistrarImpl, inverting the integer priority scale was considered, but updating the comparator preserves the existing constants (HIGHEST_SYSTEM_PRIORITY = 1000,LOWEST_SYSTEM_PRIORITY = -1000) and keeps plugin compatibility intact.AccessorRedirectTransformer, passing the rename map through an explicit post-processing step was considered, but keeping aConcurrentHashMapdirectly on the processor is cleaner and safe for parallel jar transformations.Additional Notes
None.