-
Notifications
You must be signed in to change notification settings - Fork 14
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
Basic mapping migration #57
Conversation
plugin/src/main/java/com/gtnewhorizons/retrofuturagradle/modutils/ModUtils.java
Outdated
Show resolved
Hide resolved
plugin/src/main/java/com/gtnewhorizons/retrofuturagradle/modutils/MigrateMappingsTask.java
Outdated
Show resolved
Hide resolved
db5f47e
to
612411e
Compare
Doesn't migrate yet, it just creates a diff between the current mappings and the target (hardcoded for now) and writes it to a file. I had to add the Paper and Sonatype repos for each subproject so they wouldn't complain about not being able to find Mercury. I don't know if there's a better to solve this.
Fixes Lorenz's service files not getting relocated
- Fix wrong dependency names - Fix absolute paths not working
Automatically wires up stuff like error messages and path resolution
612411e
to
262117c
Compare
Found some things I want to change:
|
Fixes task not rerunning if only the source mappings changed since the last run
cp.from(project.files(project.getTasks().named("packagePatchedMc", Jar.class))); | ||
cp.from( | ||
project.getExtensions().getByType(JavaPluginExtension.class).getSourceSets() | ||
.getByName("injectedTags").getOutput()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not entirely sure if I'm supposed to use .named
here, when I tried using it it gave me an inscrutable compiler error so I went with getting it directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ConfigurableFileCollection#from
evaluates whatever is passed as-if they're passed to Project#files
already, no need to also call Project#files
here.
This PR adds the beginnings of a
migrateMappings
task inspired by Loom's one. It can remap regular Java source code as well as mixin targets. Currently only paths to local CSV files are supported as target mappings.Testing
I tested it with Hodgepodge in the following way:
./gradlew migrateMappings --mcpDir "~/.gradle/caches/minecraft/de/oceanlabs/mcp/mcp_stable/12"
minecraft.useForgeEmbeddedMappings = false
to the buildscript (causing the default ofstable_12
to be used) and reimportrunClient
I got the game to run with only some minor adjustments.
Hodgepodge details
@Mixin(PlacementLib$.class)
to@Mixin(.class)
. I simply reverted this, but it could also be worked around by changing them to string constants.rayTraceBlocks
target inMixinWorld_FixXray
is ambiguous with the new mappings, so it needed to be made explicit (rayTraceBlocks(Lnet/minecraft/util/Vec3;Lnet/minecraft/util/Vec3;ZZZ)Lnet/minecraft/util/MovingObjectPosition;
).