Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion - Applying obfuscation mappings at classload-time #6

Open
Jannyboy11 opened this issue Jul 9, 2021 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@Jannyboy11
Copy link
Owner

Jannyboy11 commented Jul 9, 2021

Now since Spigot 1.17, there is some level of support when using the mojang class names, methods and fields.
These names are unlikely to change so plugins using them should not have to worry too much about updating every new nms revision. However, because Spigot no longer provides deobfuscated field names and method names at runtime AND mojang uses different obfuscated names each minor version, plugin developers have to reobfuscate their plugin for each nms version (post 1.17) even though their nms-related source code does not change. (for example: https://github.com/Jannyboy11/InvSee-plus-plus/tree/master/Spigot_Impl_1_17_R1 and https://github.com/Jannyboy11/InvSee-plus-plus/tree/master/Spigot_Impl_1_17_1_R1)

I suggest that ScalaLoader provides a way for ScalaPlugins to be compiled using a stable naming scheme (one of which could be Mojang's naming scheme) and then the classloader obfuscates the plugin at class-load time, to make the plugin compatible with the nms names the server is using at runtime.
There is a legal gray area here because the mojang mappings may only be used for "development purposes", but it should be fine as long as the system is agnostic from these specific names and other naming schemes could be used as well. A developer could then choose the use the mojang mappings when developing the plugin, and transform the plugin to a different (stable) naming scheme (e.g. mcp/srg, yarn, mc-dev, parchment) before distribution.

@Jannyboy11 Jannyboy11 added the enhancement New feature or request label Jul 9, 2021
@Jannyboy11 Jannyboy11 changed the title Suggestion - Applying obfuscation mappings at runtime Suggestion - Applying obfuscation mappings at classload-time Jul 9, 2021
@Jannyboy11
Copy link
Owner Author

Related to: #23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant