The tasks defined in the package com.gtnewhorizons.retrofuturagradle.mcp
can be used to create a Forge/FML-enabled development environment for mods.
Defined Gradle configurations (dependency sets):
mcpMappingData
- MCP mapping data (SRG and MCP name CSVs)forgeUserdev
- Forge/FML SDK distribution zippatchedMinecraft
(Source Set) - The generated patched decompiled sources of the game+Forge if enabledmcLauncher
(Source Set) - GradleStart and related files for setting up the deobfuscated FML runtime to run the dev client&serverreobfJarConfiguration
- dependencies of the reobfuscated jar for publishingobfRuntimeClasses
- extendsreobfJarConfiguration
, used for running the obfuscated environment
In order of operations (some of them can execute in parallel):
downloadFernflower
- downloads the Fernflower decompilerextractMcpData
- extractsmcpMappingData
to~/.gradle/caches/minecraft/de/oceanlabs/mcp/mcp_stable/12/
(example for stable-12)extractForgeUserdev
- extractsfmlUserdev
to~/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.4.1614-1.7.10/unpacked/
(example for 1.7.10)generateForgeSrgMappings
- generates remapping configuration files at either the forge userdev folder or mcp folder (depending on the source of primary mcp mappings,minecraft.getUseForgeEmbeddedMappings()
)mergeVanillaSidedJars
- merges the client&server, adding appropriate@SideOnly
annotations intobuild/rfg/vanilla_merged_minecraft.jar
deobfuscateMergedJarToSrg
- deobfuscates the merged jar with the SRG naming scheme (func_12345_a
) intobuild/rfg/srg_merged_minecraft.jar
, it also applies forge&fml access transformers if forge/fml are enableddecompileSrgJar
andcleanupDecompSrgJar
runs FernFlower on the SRG jar to generate a source jar atbuild/tmp/decompileSrgJar/ff-out/mc.jar
- keeps a cache of
SHA256(fernflower.jar)-SHA256(srg_merged_minecraft.jar).jar
outputs at~/.gradle/caches/retro_futura_gradle/fernflower-cache/
- saves the output at
build/rfg/srg_merged_minecraft-sources-rawff.jar
- keeps a cache of
cleanupDecompSrgJar
:- applies post-FF cleanup regexes (in the
FFPatcher
class) from the MCP tree atbuild/tmp/decompileSrgJar/ffpatcher.jar
- applies
.patch
files from MCP atbuild/tmp/decompileSrgJar/mcppatched.jar
- runs final cleanup tasks (AStyle autoformat, GL constant fixer, comment cleanup) at
build/tmp/decompileSrgJar/mcpcleanup.jar
- saves the output at
build/rfg/srg_merged_minecraft-sources.jar
- applies post-FF cleanup regexes (in the
patchDecompiledJar
- patches the decompiled jar with Forge/FML patches (when enabled) atbuild/rfg/srg_patched_minecraft-sources.jar
remapDecompiledJar
- finds all SRG names in the decompiled patched jar and replaces them with MCP names, also adds javadocs, output atbuild/rfg/mcp_patched_minecraft-sources.jar
- as the last task in the jar-producing chain, it removes the jars made by previous tasks to save disk space
decompressDecompiledSources
- decompresses the patched sources intobuild/rfg/minecraft-src
compilePatchedMcJava
- compiles the decompressed sources tobuild/rfg/minecraft-classes
packagePatchedMc
- packages the recompiled minecraft tobuild/rfg/recompiled_minecraft.jar
createMcLauncherFiles
- creates GradleStart java sources atbuild/rfg/launcher-src
from the templates in the plugin's resources foldercompileMcLauncherJava
- compiles the launcher files tobuild/classes/java/mcLauncher
packageMcLauncher
- creates a jar of the launcher classes atbuild/rfg/mclauncher.jar
runClient
- runs the deobfuscated client with the main jar, runtimeClasspath, patched mc&mcLauncher on the classpathrunServer
- runs the deobfuscated server with the main jar, runtimeClasspath, patched mc&mcLauncher on the classpathjar
- modified packaging task to set the classifier todev
reobf<JarTaskName>
, includingreobfJar
- reobfuscates the given jar into a jar with an identical name and no classifier set (custom instances of ReobfuscatedJar tasks can be made that don't require a Jar task input)runObfClient
- runs the obfuscated client with the reobfed jar, obfuscatedRuntimeClasspath, forge-univeral and vanilla client on the classpathrunObfServer
- runs the obfuscated server with the reobfed jar, obfuscatedRuntimeClasspath, forge-univeral and vanilla server on the classpath Currently unused tasks:installBinaryPatchedVersion
- generates a patched jar using the binary patching method instead of the source patching method of installing ForgesrgifyBinpatchedJar
- deobfuscates the binary patched jar to SRG names
All of these tasks are registered in the plugin/src/main/java/com/gtnewhorizons/retrofuturagradle/mcp/MCPTasks.java
constructor.
This class also provides getters for all of the tasks and the mentioned files/directories for ease of use.