MinecraftForge / ForgeGradle

Minecraft mod development framework used by Forge and FML for the gradle build system
GNU Lesser General Public License v2.1
517 stars 444 forks source link

Add support for `parchment` mappings channel #796

Closed SizableShrimp closed 3 years ago

SizableShrimp commented 3 years ago

Parchment data is provided from the ParchmentMC team. This PR adds support to use Parchment mappings inside of ForgeGradle for modding development. Draft because it could probably be reworked to be better and simpler, but from testing it seems to work well in its current state.

3TUSK commented 3 years ago

There has been a related PR (#761: expanding the channel system to be more generic). I wonder SizableShrimp's stance on that PR. That is, is there any chance that two PRs can incorporate each other?

SizableShrimp commented 3 years ago

Ater has plans to close that PR once this one is merged I believe.

LexManos commented 3 years ago

Anyways, just a update on this, due to some design decisions of parchment, this is still not in a state that can be pulled. We'll add support eventually but it still needs some work.

LexManos commented 3 years ago

Alright, so this looks fine as a generic channel extension API. The main thing is I do not want to play favorites with data sources. Combined with not being a fan of Parchment's rolling archive scheme. They should be able to add a addon for this in one simple class. Hell it could be done via a include ('URL') style build script.

reserveword commented 1 year ago

How do I add a custom channel? I tried

channelProviders.addProvider(new ChannelProvider() {
    Set<String> getChannels() {
        println "channels"
        return ImmutableSet.of('yarn')
    }

    File getMappingsFile(MCPRepo mcpRepo, Project project, String channel, String version) {
        String desc = "net.fabricmc:yarn:" + version + ":v2@zip";
        println 'get' + desc
        return MavenArtifactDownloader.manual(project, desc, false);
    }
})

but it didn't work. It seems that channelProviders get reset after I changed it. error says:

Error getting artifact: net.minecraft:mappings_yarn:1.0.1:null@zip from  MCPRepo
java.lang.IllegalArgumentException: Unknown mapping provider: yarn_1, currently loaded: [stable_nodoc, snapshot_nodoc, stable, official, snapshot]
gigaherz commented 1 year ago

Please do not post in random issues for help questions, we have a forum, and a discord server where you can ask questions.