Skip to content

Keep Remapper's access-flag overloads so MCPC+ can remap Bukkit plugins - #2

Merged
MisterSandFR merged 1 commit into
NationsGlory:mainfrom
Loyto-SKHR:main
Sep 24, 2026
Merged

MisterSandFR merged 1 commit into
NationsGlory:mainfrom
Loyto-SKHR:main

Conversation

@Loyto-SKHR

Copy link
Copy Markdown
Contributor

Problem

With agent 2.1.0, no Bukkit plugin loads on MCPC+ 1.6.4. Every plugin fails with:

Could not load 'plugins/WorldEdit.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.ClassNotFoundException: Failed to remap class com.sk89q.worldedit.bukkit.WorldEditPlugin
Caused by: java.lang.NoSuchMethodError: 'java.lang.String org.objectweb.asm.commons.Remapper.mapFieldName(java.lang.String, java.lang.String, java.lang.String, int)'
    at net.md_5.specialsource.RemappingClassAdapter.visitField(RemappingClassAdapter.java:125)

MCPC+ remaps every plugin class with its bundled SpecialSource, which calls
Remapper.mapFieldName and Remapper.mapMethodName with a fourth argument (the
member's access flags). MCPC+'s ASM 4 had these overloads; stock ASM 9 does not.
Plugins depending on a failed one (e.g. anything needing WorldEdit) are then skipped too.

Fix

In patchAsm, the bundled Remapper gets the two overloads back, as MCPC+'s ASM 4 had them:

  • mapFieldName(owner, name, desc) / mapMethodName(owner, name, desc) call the
    4 argument version with access = 0;
  • the new mapFieldName(owner, name, desc, int) / mapMethodName(owner, name, desc, int)
    return the name unchanged.

SpecialSource's JarRemapper overrides the 4 argument methods, so plugin classes are
remapped whichever overload ASM or SpecialSource calls. The patch fails the build if
the methods are missing or already present, like the other ASM patches.

Only build.gradle changes.

Testing

  • Scanned every ASM reference in the MCPC+ 1.6.4 server jar against the bundled ASM 9.7:
    these two overloads were the only missing members.
  • Remapped a test class with MCPC+'s JarRemapper: the original bundled ASM reproduces
    the NoSuchMethodError, the patched Remapper renames the class, field and method correctly.

@MisterSandFR
MisterSandFR merged commit a5c677a into NationsGlory:main Sep 24, 2026
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.

2 participants