buildscript { repositories { maven { url = 'https://maven.minecraftforge.net' } mavenCentral() } dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true } } apply plugin: 'java' apply plugin: 'net.minecraftforge.gradle' apply plugin: 'eclipse' apply plugin: 'maven-publish' archivesBaseName = mod_name version = "forge-${minecraft_version}-${mod_version}" group = mod_group java.toolchain.languageVersion = JavaLanguageVersion.of(16) minecraft { mappings channel: 'official', version: minecraft_version // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Currently, this location cannot be changed from the default. runs { client { workingDirectory project.file('run') ideaModule "${rootProject.name}.${project.name}.main" mods { examplemod { source sourceSets.main source project(":Common").sourceSets.main } } } server { workingDirectory project.file('run') ideaModule "${rootProject.name}.${project.name}.main" mods { examplemod { source sourceSets.main source project(":Common").sourceSets.main } } } data { workingDirectory project.file('run') ideaModule "${rootProject.name}.${project.name}.main" args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') mods { examplemod { source sourceSets.main source project(":Common").sourceSets.main } } } } } sourceSets.main.resources { srcDir 'src/generated/resources' } repositories { } dependencies { minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" compileOnly project(":Common") } jar { dependsOn ":Common:compileJava" from project(":Common").sourceSets.main.output manifest { attributes([ "Specification-Title" : mod_name, "Specification-Vendor" : mod_author, "Specification-Version" : "1", "Implementation-Title" : project.name, "Implementation-Version" : project.jar.archiveVersion, "Implementation-Vendor" : mod_author, "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") ]) } } jar.finalizedBy('reobfJar') publishing { publications { mavenJava(MavenPublication) { artifact jar } } repositories { maven { url "file://${project.projectDir}/mcmodsrepo" } } }