Skip to content

Conversation

@HowardZHY
Copy link
Owner

Motivation

  • Reduce duplicated remapper logic by merging common mapping, caching and superclass-merging behavior into a single base class so both legacy and custom remappers share the same implementation.
  • Make it easier to maintain class/method/field mapping behavior and parent resolution across the two existing remapper implementations.
  • Preserve Forge-specific parent resolution and class-patching behavior while centralizing the generic mapping mechanics.

Description

  • Add BaseRemapper which centralizes map/unmap, raw/merged mapping caches, getFieldMap/getMethodMap, and mergeSuperMaps logic (new file: src/main/java/space/libs/asm/BaseRemapper.java).
  • Update RemapTransformer to extend BaseRemapper, to populate rawFieldMaps/rawMethodMaps from the parsed ImmutableTable and to use the shared parent-resolution and merging implementation (src/main/java/space/libs/asm/RemapTransformer.java).
  • Update CustomRemapRemapper to extend BaseRemapper, call finalizeMappings(...) when loading mappings, and implement getParentInfo(...) using Forge's ClassPatchManager to retain Forge-specific parent/interface resolution (src/main/java/space/libs/asm/CustomRemapRemapper.java).
  • Preserve existing special-case behavior such as static-field type lookup and Forge mapping helpers (getRealName/getLegacyName) while removing duplicate mapping code.

Testing

  • No automated tests were executed as part of this change.
  • Changes were applied and committed locally (Refactor remapper base) but no build or test tasks (e.g. gradle build or unit tests) were run in this rollout.

Codex Task

@HowardZHY HowardZHY marked this pull request as draft February 6, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant