Mixin icon indicating copy to clipboard operation
Mixin copied to clipboard

Refmap remapping on modlauncher in dev

Open Barteks2x opened this issue 4 years ago • 9 comments

Legacy FML agent has this code https://github.com/SpongePowered/Mixin/blob/4585277f9f4b026065ce749f279ea1ad4919c4f1/src/launchwrapper/java/org/spongepowered/asm/launch/platform/MixinPlatformAgentFMLLegacy.java#L314-L324 and this allows remapping refmap to work. Modlauncher specific agent doesn't have an equivalent.

While this wouldn't allow mods using mixin to work in dev just by putting them into mods folder (because that's not supported at all), this should allow dependencies added with fg.deobf to work (since the dependency remaping uses this code https://github.com/MinecraftForge/InstallerTools/blob/9147fcae6e088daf02d31a01ce6724ce91361ffa/src/main/java/net/minecraftforge/installertools/SrgMcpRenamer.java#L99-L112 which would remap shadows and overwrites correctly).

Barteks2x avatar Jan 20 '21 14:01 Barteks2x

You're right this was an oversight when I was making the modlauncher agent, I had intended to do this once I figured out what mapping provider is available in modlauncher or fml but it slipped my mind. Thanks for opening an issue, will look into this.

Mumfrey avatar Jan 20 '21 16:01 Mumfrey

This can be solved by adding Java system properties,

minecraft {
    runs {
        client {
            property 'mixin.env.remapRefMap', 'true'
            property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
        }
    }
}

then re-run genIntellijRuns and refresh gradle project

BloCamLimb avatar Mar 05 '21 11:03 BloCamLimb

The fix @BloCamLimb suggested doesn't work for me, and I can't figure out why.

build.gradle: https://gist.github.com/GingerIndustries/03efeaed0b2ced30c648c9c33d00df3a

gingershaped avatar Jul 15 '21 22:07 gingershaped

I may be listing Supplementaries as a dependency wrong.

gingershaped avatar Jul 15 '21 23:07 gingershaped

This can be solved by adding Java system properties,

minecraft {
    runs {
        client {
            property 'mixin.env.remapRefMap', 'true'
            property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
        }
    }
}

then re-run genIntellijRuns and refresh gradle project

It seems you also need to add those properties to the other runs in 1.18.2 I don't know about earlier ones. without them runData for datagen purposes failed.

GaeaKat avatar Mar 29 '22 14:03 GaeaKat

This can be solved by adding Java system properties,

minecraft {
    runs {
        client {
            property 'mixin.env.remapRefMap', 'true'
            property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
        }
    }
}

then re-run genIntellijRuns and refresh gradle project

It seems you also need to add those properties to the other runs in 1.18.2 I don't know about earlier ones. without them runData for datagen purposes failed.

Yes, you're right. Generally, you should also apply these to server and data. But if you add MixinGradle plugin, you don't need these setups.

BloCamLimb avatar Mar 29 '22 14:03 BloCamLimb

The fix BloCamLimb suggested doesn't work for me, and I can't figure out why.

It won't work correctly if they don't use the same mappings, but that may not be the issue here anyways but that is something to note.

0-x-2-2 avatar Apr 12 '22 10:04 0-x-2-2

can someone please give tutorial to little mod author who can barely lambda how i can depend a mod that depends Architectury

19Phin avatar Mar 26 '23 01:03 19Phin

@19Phin Don't bump unrelated issues for your support query. I don't really see how that question is related to Mixin in the first place either -- you probably want to talk to the Architectury people or the original mod developer if anything.

zml2008 avatar Mar 26 '23 02:03 zml2008