123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254 |
- // For those who want the bleeding edge
- buildscript {
- repositories {
- maven { url = 'https://maven.minecraftforge.net/' }
- maven { url = 'https://maven.parchmentmc.org' }
- jcenter()
- mavenCentral()
- }
- dependencies {
- classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
- classpath 'org.parchmentmc:librarian:1.+'
- }
- }
- apply plugin: 'java'
- apply plugin: 'idea'
- apply plugin: 'net.minecraftforge.gradle'
- apply plugin: 'org.parchmentmc.librarian.forgegradle'
- apply plugin: 'maven-publish'
- apply plugin: 'eclipse'
- apply from: 'https://raw.githubusercontent.com/SizableShrimp/Forge-Class-Remapper/main/classremapper.gradle'
- ///////////////////////////////////////////////////
- // IDE Settings
- ///////////////////////////////////////////////////
- idea {
- project {
- languageLevel = '17' // Not sure this is proper or even needed anymore, verify it
- }
- }
- ///////////////////////////////////////////////////
- // ForgeGradle
- ///////////////////////////////////////////////////
- version = (hasProperty("CIRevision") ? CIRevision : mod_version)
- group = group_name
- archivesBaseName = "${mod_id}-${minecraft_version}"
- java.toolchain.languageVersion = JavaLanguageVersion.of(17)
- compileJava.options.compilerArgs << "-Xlint:all,-classfile,-processing,-deprecation" << "-Werror"
- minecraft {
- mappings channel: "official", version: "1.18.2"
- // https://ldtteam.jfrog.io/ui/native/parchmentmc-public/org/parchmentmc/data
- //mappings channel: 'parchment', version: '2021.10.31-1.17.1'
- //version = minecraft_version + "-" + forge_version // grab latest forge
- //makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
- accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
- //replace '@mod_version@', version
- //replace '@mod_id@', mod_id
- //replace '@ci_build@', hasProperty("CIRevision") ? 'true' : 'false'
- //replaceIn 'TwilightForestMod.java'
- //replace '@VERSION@', project.version
- runs {
- client {
- workingDirectory project.file('run')
- property 'forge.logging.markers', 'REGISTRIES'
- property 'forge.logging.console.level', 'debug'
- property 'fml.earlyprogresswindow', 'false'
- property 'mixin.env.disableRefMap', 'true'
- mods {
- twilightforest {
- source sourceSets.main
- }
- }
- }
- server {
- workingDirectory project.file('run')
- // Recommended logging level for the console
- property 'forge.logging.console.level', 'debug'
- property 'mixin.env.disableRefMap', 'true'
- mods {
- twilightforest {
- source sourceSets.main
- }
- }
- }
- data {
- workingDirectory project.file('run')
- properties 'fml.earlyprogresswindow': 'false'
- property 'mixin.env.disableRefMap', 'true'
- mods {
- twilightforest {
- source sourceSets.main
- }
- }
- args '--mod', 'twilightforest', '--all',
- '--existing', '"' + file('src/main/resources/') + '"',
- '--existing', '"' + file('src/generated/resources/') + '"',
- '--output', '"' + file('src/generated/resources/') + '"'
- }
- }
- }
- sourceSets.main.resources {
- srcDir 'src/generated/resources'
- }
- /*
- processResources {
- //replaceIn 'assets/twilightforest/patchouli_books/guide/book.json'
- //replace '@EDITION@', project.version
- // this will ensure that this task is redone when the versions change.
- inputs.property "version", project.version
- inputs.property "mcversion", project.minecraft.version
- // replace stuff in mcmod.info, nothing else
- from(sourceSets.main.resources.srcDirs) {
- //include '.info'
- //include '.properties'
- include 'assets/twilightforest/patchouli_books/guide/book.json'
- // replace version and mcversion
- expand ([
- 'version':project.version,
- 'mcversion':project.minecraft.version,
- 'forge_version': forge_version,
- 'mod_version': mod_version,
- 'minecraft_version': minecraft_version,
- 'edition': (project.version - (mod_version + '.')),
- 's': '$'
- ])
- }
- // copy everything else, thats not the mcmod.info
- from(sourceSets.main.resources.srcDirs) {
- exclude 'mcmod.info'
- exclude 'assets/twilightforest/patchouli_books/guide/book.json'
- }
- }*/
- compileJava {
- options.encoding = 'UTF-8'
- }
- processResources {
- filesMatching("META-INF/mods.toml") {
- expand([
- 'version': "${project.version}"
- ])
- }
- }
- jar {
- classifier = 'universal'
- manifest {
- attributes(["Specification-Title" : "Twilight Forest",
- "Specification-Vendor" : "TeamTwilight",
- "Specification-Version" : "${version}",
- "Implementation-Title" : project.name,
- "Implementation-Version" : "${version}",
- "Implementation-Vendor" : "TeamTwilight",
- "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")],)
- }
- }
- repositories {
- maven {
- name 'progwm\'s Maven' // JEI + Mantle + TCon
- url 'https://dvs1.progwml6.com/files/maven'
- }
- maven {
- name 'tterrag\'s Maven' // CTM
- url 'https://maven.tterrag.com/'
- }
- maven {
- name 'Jared\'s Maven' // Immersive Engineering + Patchouli
- url 'https://maven.blamejared.com/'
- }
- maven {
- name 'theillusivec4\'s Maven' //Curios
- url 'https://maven.theillusivec4.top/'
- }
- //maven {
- // name 'player\'s Maven' // Forestry
- // url 'http://maven.ic2.player.to/'
- //}
- maven {
- url "https://www.cursemaven.com"
- content {
- includeGroup "curse.maven"
- }
- }
- }
- dependencies {
- // progwml6
- compileOnly fg.deobf("mezz.jei:jei-${minecraft_version}:${jei_version}:api")
- runtimeOnly fg.deobf("mezz.jei:jei-${minecraft_version}:${jei_version}")
- implementation fg.deobf("slimeknights.mantle:Mantle:${minecraft_version}-${mantle_version}")
- implementation fg.deobf("slimeknights.tconstruct:TConstruct:${minecraft_version}-${tcon_version}")
- // tterrag
- implementation fg.deobf("team.chisel.ctm:CTM:${ctm_version}")
- // blamejared
- implementation fg.deobf("blusunrize.immersiveengineering:ImmersiveEngineering:${immersive_engineering_version}")
- implementation fg.deobf("vazkii.patchouli:Patchouli:${patchouli_version}")
- // theillusivec4
- implementation fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}")
- // player
- //deobfCompile "net.sengir.forestry:forestry_${minecraft_version}:${forestry_version}"
- implementation fg.deobf("curse.maven:the-undergarden-379849:3810810")
- minecraft "net.minecraftforge:forge:${project.minecraft_version}-${project.forge_version}"
- }
- jar.finalizedBy('reobfJar')
- publishing {
- publications {
- mavenJava(MavenPublication) {
- afterEvaluate {
- artifact project.jar
- artifact project.sourceJar
- }
- setGroupId 'teamtwilight'
- setArtifactId project.mod_id
- }
- }
- repositories {
- maven {
- //url "file:///${project.projectDir}/mcmodsrepo"
- url "https://modmaven.dev:443/artifactory/local-releases"
- credentials {
- username System.getenv('ARTIFACTORY_USER')
- password System.getenv('ARTIFACTORY_PASS')
- }
- }
- }
- }
- task sourceJar(type: Jar, dependsOn: 'classes') {
- from sourceSets.main.allSource
- classifier = 'sources'
- }
|