import java.util.stream.Collectors import net.minecraftforge.gradle.common.task.SignJar buildscript { repositories { maven { url = 'https://files.minecraftforge.net/maven' } jcenter() mavenCentral() maven {url='https://dist.creeper.host/Sponge/maven'} } dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT' } } apply plugin: 'net.minecraftforge.gradle' // Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. apply plugin: 'eclipse' apply plugin: 'maven-publish' version = "${mod_version}" group = "malte0811.${modid}" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "${modid}" def mixinConfigs = ["predicates", "fastmap", "nopropertymap"].stream() .map({s -> archivesBaseName+"."+s+".mixin.json"}) .collect(Collectors.toList()) def mixinConfigArg = mixinConfigs.stream() .map({s -> "-mixin.config="+s}) .collect(Collectors.toList()) def mixinConfigManifestEntry = mixinConfigs.join(","); sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. minecraft { // The mappings can be changed at any time, and must be in the following format. // snapshot_YYYYMMDD Snapshot are built nightly. // stable_# Stables are built at the discretion of the MCP team. // Use non-default mappings at your own risk. they may not always work. // Simply re-run your setup task after changing the mappings to update your workspace. mappings channel: "snapshot", version: "${mapping}-${mcp_version}" // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. //accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Default run configurations. // These can be tweaked, removed, or duplicated as needed. runs { client { workingDirectory project.file('run') args mixinConfigArg property 'mixin.env.disableRefMap', 'true' property 'mixin.debug.export', 'true' // Recommended logging level for the console property 'forge.logging.console.level', 'debug' mods { examplemod { source sourceSets.main } } } server { workingDirectory project.file('run') args mixinConfigArg arg "-nogui" property 'mixin.env.disableRefMap', 'true' // Recommended logging level for the console property 'forge.logging.console.level', 'debug' mods { examplemod { source sourceSets.main } } } } } def customGradle = rootProject.file('custom.gradle'); if (customGradle.exists()) { apply from: customGradle; } repositories{ maven { // location of the maven that hosts JEI files name = "Progwml6 maven" url = "https://dvs1.progwml6.com/files/maven/" } maven { // location of a maven mirror for JEI files, as a fallback name = "ModMaven" url = "https://modmaven.k-4u.nl" } maven { name = "BlameJared" url = "https://maven.blamejared.com/" } jcenter() mavenCentral() } dependencies { minecraft "net.minecraftforge:forge:${mc_version}-${forge_version}" runtimeOnly fg.deobf("mezz.jei:jei-1.16.3:7.6.0.49") } // Example for how to get properties into the manifest for reading by the runtime.. jar { manifest { attributes([ "Specification-Title": "${modid}", "Specification-Version": "1", // We are version 1 of ourselves "Implementation-Title": project.name, "Implementation-Version": "${version}", "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), "MixinConfigs": mixinConfigManifestEntry ]) } } apply plugin: 'org.spongepowered.mixin' task signJar(type: SignJar, dependsOn: jar) { onlyIf { project.hasProperty('keyStore') } if (project.hasProperty('keyStore')) { keyStore = project.keyStore alias = project.storeAlias storePass = project.storePass keyPass = project.storePass inputFile = jar.archivePath outputFile = jar.archivePath } else { logger.warn("No key store found, not signing the output jar\n") } } build.dependsOn signJar mixin { add sourceSets.main, "${modid}.refmap.json" }