Skip to content

Major refactor and code clean, as well as introducing Official Mappings and obf->mapped support. - #48

Open
LexManos wants to merge 9 commits into
tterrag1098:masterfrom
LexManos:Official
Open

Major refactor and code clean, as well as introducing Official Mappings and obf->mapped support.#48
LexManos wants to merge 9 commits into
tterrag1098:masterfrom
LexManos:Official

Conversation

@LexManos

@LexManos LexManos commented Oct 3, 2019

Copy link
Copy Markdown

So, this is a fairly big rewrite/refactor.
Updated gradle
Updated dependencies
Removed a bunch of unneeded deps (trove, guava, apache) saves 6MB in the fat jar.
Updated to maven publish plugin for gradle.
Added sources jar to published artifacts
Added 'Minecraft' dropdown and download buttons to the main menu, this will download MCP/MCPConfig so we have access to the SRG files.
Massive amounts of deadcode cleanup/removal. Data Objects now have a central static management class {MappingsVersions/MinecraftVersions/MCPVersions}
Allow downloading of everything above for both CLI and in GUI.

Anyways, I started poking this because I wanted to convert some notch named jars to MCP mappings.
But turns out this project doesnt do that. It ONLY does SRG->MCP names in a very basic way...

Perhaps someone who cares could come along and expand the actual remapping to be intelegent and do full SRG remappings.


Update libraries
Remove guava, apache, and trove dependencies, they were just simple macro helpers, that are no longer needed with J8+ and added 6MB to the fatjar.
Added downloading of MCP/MCPConfig.
…mcpbot export, until MCPBot is updated to properly index on maven.
Comment thread build.gradle Outdated
Download Minecraft client/server jar
Add inheritance calculation and mapping to allow for OBF->MCP renaming.
Use ASM's ClassRemapper adapter as it is more robust then homebrewing it.
@LexManos

LexManos commented Oct 4, 2019

Copy link
Copy Markdown
Author

Alright, so added full SRG remapping.
You can now remap OBF -> MCP.

@Niko-sk2x

Niko-sk2x commented Oct 4, 2019

Copy link
Copy Markdown

Does that change the way srg->mcp is done? This may actually break one of the major use cases I have for BON2. Remapping mods that use mixin from srg to mcp relied on the simpler way of remapping.

Mixin classes generally can contain methods with SRG names that (currently) need to be remapped for mixin to work (I think it is considered a mixin bug bit it's not fixed yet), but if inheritance is taken into account, they won't be remapped, because the mixin class isn't the class that normally contains the srg name (and this is also why runtime remapping in 1.12.x doesn't handle it)

@LexManos

LexManos commented Oct 4, 2019

Copy link
Copy Markdown
Author

It does srg->mcp after obf -> srg
https://github.com/tterrag1098/BON2/pull/48/files#diff-9b833ebdfffbacc08dc9602f1f9314e8R34

@LexManos LexManos changed the title Major refactor and code clean, as well as introducing Official Mappings support. Major refactor and code clean, as well as introducing Official Mappings and obf->mapped support. Oct 6, 2019
@Anora

Anora commented Mar 4, 2020

Copy link
Copy Markdown

would love to see mappings for ever older versions

@LexManos

LexManos commented Mar 27, 2020

Copy link
Copy Markdown
Author

Official mappings are only avalible for versions Mojang releases.
As for MCP Mappings, that data may of been lost, but if people submit it we could include it.
See the https://github.com/MinecraftForge/MCPConfig project for the obf->srg mappings. And MCPBot for Srg->Mapped names.

As for this PR in general, no idea if it'll ever be uptaken, but feel free to clone my fork and build yourself.

@Parker8283 Parker8283 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm honestly surprised that this project still has a userbase. Thanks Lex for the changes! Hope that tterrag looks at it soon, would be cool to see this upstreamed.

@bloodmc

bloodmc commented May 6, 2021

Copy link
Copy Markdown

I just tested this and ran into 2 issues

  1. BON2 failed to remap the following line in Mekanism's jar

https://github.com/mekanism/Mekanism/blob/1.16.x/src/main/java/mekanism/common/util/MekanismUtils.java#L72

With the original jar containing the SRG mapping

DIRECTION_CODEC = IStringSerializable.createEnumCodec((Supplier)Direction::values, (Function)Direction::func_176739_a);

MCPBot reports

MC 1.16.5: net/minecraft/util/Direction.byName
Name: a => func_176739_a => byName
Comment: Get the facing specified by the given name
Side: BOTH
AT: public net.minecraft.util.Direction func_176739_a(Ljava/lang/String;)Lnet/minecraft/util/Direction; # byName
  1. The version manifest URL doesn't contain the latest 1.16 versions as stated in issue No forge versions show up #52
    I resolved this by using another URL then adjusting the downloader.

After fixing the version manifest, I did another test with a few McJtyMods which seemed to load fine in my workspace.

Also, now that Forge is using official mappings, are there tsrg's available for remapping SRG to Official?

@LexManos

LexManos commented May 9, 2021

Copy link
Copy Markdown
Author
  1. It should remap fine.. Lambdas/method handles should be good. Would need a test case/way to reproduce and debug.
  2. This is because the bot has not been updated to kick off our page gen now that the servers have moved. Could be fixed in BON by either using the xml directly, or fixed in the bot by kicking the correct files.

As for SRG->Official.. No thats not how this works. Forge is not 'using official' It's still using SRG names for runtime/devetime. It just uses official as if it were a MCPBot export. Which is what this does: LexManos@4bcf352#diff-fc439e3caafda604b0e6d265439166b2fd1c147e6ba71b1bec90cd2c43d5e9c9R96

@adamsong

adamsong commented Nov 14, 2021

Copy link
Copy Markdown

The command line options do not work, there is no way to specify official mappings.

@LexManos

Copy link
Copy Markdown
Author

Nothing, mcpbot is dead, if someone wants to spend the time updating my fork we could probably publish it. But this PR doesn't seem like this will ever be merged. Next time I need this tool gain, i'll fix my fork. But who knows when that'll be.

@Attack8

Attack8 commented Apr 25, 2023

Copy link
Copy Markdown

I compiled it myself and it cannot procces the mappings for newer versions, stating:
Failed to read MCPConfig data from: C:\Users_____.gradle\caches\forge_gradle\maven_downloader\de\oceanlabs\mcp\mcp_config\1.18.2\mcp_config-1.18.2.zip Unknown spec: 3
Any ideas on an easy fix?

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.

8 participants