ScalaPluginLoader icon indicating copy to clipboard operation
ScalaPluginLoader copied to clipboard

Make compatible with Paper's plugin remapping.

Open Jannyboy11 opened this issue 1 year ago • 1 comments

Paper's plugin classloader soon will use bytecode modification to remap plugins. I think it performs the following two modifications:

  • Remove craftbukkit version from nms classes.
  • Remap plugins that use nms to use mojang-mapped classes instead of obfuscated-mapped classes.

ScalaLoader's plugin bytecode transormer should apply the same transformations, it should call ReflectionRemapper and PluginRemapper to apply their transformations. I think this is best done in Platform.java; a PaperPlatform could be implemented which extends from Platform. A new constant for this platform will be added too, and Platform#detect shall be updated. A note on calling the reflection remapper; it should be called with Paper's ASM dependency, not ScalaLoader's.

See: https://github.com/PaperMC/testing/releases/tag/no-relocation, Discord announcement: https://discord.com/channels/289587909051416579/1077385604012179486/1206605416012976178

Jannyboy11 avatar Feb 12 '24 21:02 Jannyboy11

Paper 1.20.5 now includes these new remapping changes, meaning this is now more urgent than before.

Jannyboy11 avatar May 04 '24 14:05 Jannyboy11