From 05761cb243159bc7dcf3cd39d40090993913e804 Mon Sep 17 00:00:00 2001 From: David Quintana Date: Wed, 12 Dec 2018 05:04:23 +0100 Subject: [PATCH] Create a userdev-specific main, and include it as an injected file in the userdev jar. (#5231) --- build.gradle | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index ee711d2..ce344c1 100644 --- a/build.gradle +++ b/build.gradle @@ -39,6 +39,26 @@ minecraft { // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. //accessTransformer = file('my_at.cfg') + + // default run configurations. + // these can be tweaked, removed, or duplicated as needed. + runConfig { + name= "Minecraft Client" + main= "net.minecraftforge.userdev.UserdevLauncher" + ideaModuleName = "${project.name}_main" + workingDirectory = project.file("run").canonicalPath + environment "target", "fmldevclient" + environment "assetDirectory", downloadAssets.output.absolutePath + } + + runConfig { + name= "Minecraft Server" + main= "net.minecraftforge.userdev.UserdevLauncher" + ideaModuleName = "${project.name}_main" + workingDirectory = project.file("run").canonicalPath + environment "target", "fmldevserver" + environment "assetDirectory", downloadAssets.output.absolutePath + } } dependencies { @@ -76,7 +96,7 @@ processResources { // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { - include 'mcmod.info' + include 'META_INF/mods.toml' // replace version and mcversion expand 'version':project.version, 'mcversion': '@MC_VERSION@' @@ -84,6 +104,6 @@ processResources { // copy everything else except the mcmod.info from(sourceSets.main.resources.srcDirs) { - exclude 'mcmod.info' + exclude 'META_INF/mods.toml' } }