|
| 1 | +plugins { |
| 2 | + id("multiloader-loader") |
| 3 | + id("net.minecraftforge.gradle") |
| 4 | + id("org.spongepowered.mixin") |
| 5 | +} |
| 6 | + |
| 7 | +dependencies { |
| 8 | + minecraft("net.minecraftforge:forge:${minecraft_version}-${forge_version}") |
| 9 | + annotationProcessor("org.spongepowered:mixin:${mixin_version}:processor") |
| 10 | + compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:${mixinextras_version}")) |
| 11 | + |
| 12 | + // JiJ MixinExtras |
| 13 | + implementation(jarJar("io.github.llamalad7:mixinextras-forge:${mixinextras_version}")) { |
| 14 | + jarJar.ranged(it, "[${mixinextras_version},)") |
| 15 | + } |
| 16 | + |
| 17 | + // Cloth Config API |
| 18 | + api("me.shedaniel.cloth:cloth-config-forge:${clothconfig_version}") |
| 19 | + |
| 20 | + // Better Modlist |
| 21 | + implementation("maven.modrinth:sbpqhzIG:${bettermodlist_version}") |
| 22 | +} |
| 23 | + |
| 24 | +mixin { |
| 25 | + add(sourceSets.main, "${mod_id}.refmap.json") |
| 26 | + config("${mod_id}.mixins.json") |
| 27 | + config("${mod_id}.forge.mixins.json") |
| 28 | +} |
| 29 | + |
| 30 | +sourceSets.main.resources.srcDir "src/generated/resources" |
| 31 | + |
| 32 | +jarJar.enable() |
| 33 | + |
| 34 | +tasks.jar.configure { |
| 35 | + archiveClassifier.set("pure") |
| 36 | + finalizedBy("reobfJar") |
| 37 | +} |
| 38 | + |
| 39 | +tasks.jarJar.configure { |
| 40 | + archiveClassifier.set("") |
| 41 | + finalizedBy("reobfJarJar") |
| 42 | +} |
| 43 | + |
| 44 | +afterEvaluate { |
| 45 | + // Required due to direct reference to fat jar file in root build.gradle publish task |
| 46 | + tasks.named("publishGithub").configure { it.dependsOn(tasks.named("jarJar")) } |
| 47 | + tasks.named("publishModrinth").configure { it.dependsOn(tasks.named("jarJar")) } |
| 48 | + tasks.named("publishCurseforge").configure { it.dependsOn(tasks.named("jarJar")) } |
| 49 | +} |
| 50 | + |
| 51 | +minecraft { |
| 52 | + mappings channel: "official", version: minecraft_version |
| 53 | + copyIdeResources = true // Calls processResources when in dev |
| 54 | + |
| 55 | + if (file("src/main/resources/META-INF/accesstransformer.cfg").exists()) { |
| 56 | + accessTransformer = file("src/main/resources/META-INF/accesstransformer.cfg") |
| 57 | + } |
| 58 | + |
| 59 | + runs { |
| 60 | + client { |
| 61 | + workingDirectory project.file('run') |
| 62 | + ideaModule "${rootProject.name}.${project.name}.main" |
| 63 | + taskName 'Client' |
| 64 | + property 'mixin.env.remapRefMap', 'true' |
| 65 | + property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" |
| 66 | + mods { |
| 67 | + modClientRun { |
| 68 | + source sourceSets.main |
| 69 | + source project(":common").sourceSets.main |
| 70 | + } |
| 71 | + } |
| 72 | + } |
| 73 | + |
| 74 | + server { |
| 75 | + workingDirectory project.file('run') |
| 76 | + ideaModule "${rootProject.name}.${project.name}.main" |
| 77 | + taskName 'Server' |
| 78 | + property 'mixin.env.remapRefMap', 'true' |
| 79 | + property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" |
| 80 | + mods { |
| 81 | + modServerRun { |
| 82 | + source sourceSets.main |
| 83 | + source project(":common").sourceSets.main |
| 84 | + } |
| 85 | + } |
| 86 | + } |
| 87 | + } |
| 88 | +} |
0 commit comments