plugins { id 'eclipse' id 'idea' id 'maven-publish' id 'net.minecraftforge.gradle' version '[6.0,6.2)' id 'org.jetbrains.kotlin.jvm' version '1.9.20' id 'org.jetbrains.kotlin.plugin.serialization' version '1.9.20' } version = "${minecraft_version}-${mod_version}" group = 'ru.yurannnzzz' base { archivesName = mod_id } java.toolchain.languageVersion = JavaLanguageVersion.of(17) minecraft { mappings channel: 'official', version: minecraft_version copyIdeResources = true runs { configureEach { workingDirectory project.file('run') property 'forge.logging.markers', 'REGISTRIES' property 'forge.logging.console.level', 'debug' property 'mixin.env.remapRefMap', 'true' property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" mods { "${mod_id}" { source sourceSets.main } } } client { property 'forge.enabledGameTestNamespaces', mod_id } server { property 'forge.enabledGameTestNamespaces', mod_id args '--nogui' } data { workingDirectory project.file('run-data') args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') } } } sourceSets.main.resources { srcDir 'src/generated/resources' } repositories { maven { name = 'Kotlin for Forge' url = 'https://thedarkcolour.github.io/KotlinForForge/' } maven { name = 'Jared\'s maven' url = 'https://maven.blamejared.com/' content { includeGroup 'mezz.jei' } } maven { name = 'Modmaven' url = 'https://modmaven.dev/' content { includeGroup 'appeng' } } } dependencies { minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" implementation "thedarkcolour:kotlinforforge:${kff_version}" implementation fg.deobf("appeng:appliedenergistics2-forge:${ae2_version}") runtimeOnly(fg.deobf("mezz.jei:jei-${minecraft_version}-forge:${jei_version}")) } tasks.named('processResources', ProcessResources).configure { var replaceProperties = [ loader_name: loader_name, loader_version_range: loader_version_range, mod_id: mod_id, mod_version: mod_version, forge_version_range: forge_version_range, minecraft_version_range: minecraft_version_range, ae2_version_range: ae2_version_range, ] inputs.properties replaceProperties filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) { expand replaceProperties + [project: project] } } tasks.named('jar', Jar).configure { manifest { attributes([ 'Specification-Title' : mod_id, 'Specification-Vendor' : "YuRaNnNzZZ", 'Specification-Version' : '1', 'Implementation-Title' : project.name, 'Implementation-Version' : project.jar.archiveVersion, 'Implementation-Vendor' : "YuRaNnNzZZ", 'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") ]) } finalizedBy 'reobfJar' } publishing { publications { register('mavenJava', MavenPublication) { artifact jar } } repositories { maven { url "file://${project.projectDir}/mcmodsrepo" } } } tasks.withType(JavaCompile).configureEach { options.encoding = 'UTF-8' }