build.gradle 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. buildscript {
  2. repositories {
  3. maven { url = 'https://maven.minecraftforge.net/' }
  4. maven { url = 'https://maven.parchmentmc.org' }
  5. mavenCentral()
  6. }
  7. dependencies {
  8. classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
  9. classpath 'org.parchmentmc:librarian:1.+'
  10. }
  11. }
  12. apply plugin: 'java'
  13. apply plugin: 'idea'
  14. apply plugin: 'net.minecraftforge.gradle'
  15. apply plugin: 'org.parchmentmc.librarian.forgegradle'
  16. apply plugin: 'maven-publish'
  17. apply plugin: 'eclipse'
  18. version = (hasProperty("CIRevision") ? CIRevision : mod_version)
  19. group = group_name
  20. archivesBaseName = "${mod_id}-${minecraft_sub_version}"
  21. java.toolchain.languageVersion = JavaLanguageVersion.of(17)
  22. compileJava.options.compilerArgs << "-Xlint:all,-classfile,-processing,-deprecation" << "-Werror"
  23. minecraft {
  24. //mappings channel: "official", version: "1.19.4"
  25. // https://ldtteam.jfrog.io/ui/native/parchmentmc-public/org/parchmentmc/data
  26. mappings channel: 'parchment', version: '1.19.3-2023.03.12-1.19.4'
  27. //version = minecraft_version + "-" + forge_version // grab latest forge
  28. //makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
  29. accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
  30. runs {
  31. client {
  32. workingDirectory project.file('run')
  33. property 'forge.logging.markers', 'REGISTRIES'
  34. property 'forge.logging.console.level', 'debug'
  35. property 'fml.earlyprogresswindow', 'false'
  36. property 'mixin.env.disableRefMap', 'true'
  37. mods {
  38. twilightforest {
  39. source sourceSets.main
  40. }
  41. }
  42. }
  43. server {
  44. workingDirectory project.file('run')
  45. property 'forge.logging.console.level', 'debug'
  46. property 'mixin.env.disableRefMap', 'true'
  47. mods {
  48. twilightforest {
  49. source sourceSets.main
  50. }
  51. }
  52. }
  53. gameTestServer {
  54. workingDirectory project.file('run')
  55. property 'forge.logging.markers', 'REGISTRIES'
  56. property 'forge.logging.console.level', 'debug'
  57. property 'forge.enabledGameTestNamespaces', 'twilightforest'
  58. mods {
  59. twilightforest {
  60. source sourceSets.main
  61. }
  62. }
  63. }
  64. data {
  65. workingDirectory project.file('run')
  66. properties 'fml.earlyprogresswindow': 'false'
  67. property 'mixin.env.disableRefMap', 'true'
  68. mods {
  69. twilightforest {
  70. source sourceSets.main
  71. }
  72. }
  73. args '--mod', 'twilightforest', '--all',
  74. '--existing', '"' + file('src/main/resources/') + '"',
  75. '--existing', '"' + file('src/generated/resources/') + '"',
  76. '--output', '"' + file('src/generated/resources/') + '"'
  77. }
  78. }
  79. }
  80. sourceSets.main.resources {
  81. srcDir 'src/generated/resources'
  82. }
  83. compileJava {
  84. options.encoding = 'UTF-8'
  85. }
  86. jar {
  87. classifier = 'universal'
  88. manifest {
  89. attributes(["Specification-Title" : "Twilight Forest",
  90. "Specification-Vendor" : "TeamTwilight",
  91. "Specification-Version" : "${version}",
  92. "Implementation-Title" : project.name,
  93. "Implementation-Version" : "${version}",
  94. "Implementation-Vendor" : "TeamTwilight",
  95. "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")],)
  96. }
  97. }
  98. repositories {
  99. maven {
  100. name 'Jared\'s Maven' // JEI
  101. url 'https://maven.blamejared.com/'
  102. }
  103. maven {
  104. name 'tterrag\'s Maven' // CTM
  105. url 'https://maven.tterrag.com/'
  106. }
  107. maven {
  108. name 'theillusivec4\'s Maven' // Curios
  109. url 'https://maven.theillusivec4.top/'
  110. }
  111. maven {
  112. name 'Tama\'s Maven' // Cross-Dim Commands
  113. url "https://maven.tamaized.com/releases"
  114. }
  115. maven {
  116. name 'Curseforge Maven' // Jade
  117. url "https://www.cursemaven.com"
  118. content {
  119. includeGroup "curse.maven"
  120. }
  121. }
  122. }
  123. dependencies {
  124. // jared
  125. implementation fg.deobf("mezz.jei:jei-${project.minecraft_sub_version}-forge:${jei_version}")
  126. // tterrag
  127. //implementation fg.deobf("team.chisel.ctm:CTM:${minecraft_version}-${ctm_version}")
  128. // theillusivec4
  129. implementation fg.deobf("top.theillusivec4.curios:curios-forge:${project.minecraft_sub_version}-${curios_version}")
  130. //curse maven
  131. implementation fg.deobf("curse.maven:jade-324717:4439089-api-4439091")
  132. //runtimeOnly fg.deobf("curse.maven:just-enough-effect-descriptions-jeed-532286:3944903")
  133. compileOnly fg.deobf("curse.maven:the-one-probe-245211:4442439")
  134. //mods we dont have compat with but are nice to have
  135. //runtimeOnly fg.deobf("team-twilight:crossdimcommands:${project.minecraft_sub_version}-1.0")
  136. minecraft "net.minecraftforge:forge:${project.minecraft_sub_version}-${project.forge_version}"
  137. }
  138. jar.finalizedBy('reobfJar')
  139. publishing {
  140. publications {
  141. mavenJava(MavenPublication) {
  142. afterEvaluate {
  143. artifact project.jar
  144. artifact project.sourceJar
  145. }
  146. setGroupId 'teamtwilight'
  147. setArtifactId project.mod_id
  148. }
  149. }
  150. repositories {
  151. maven {
  152. //url "file:///${project.projectDir}/mcmodsrepo"
  153. url "https://modmaven.dev:443/artifactory/local-releases"
  154. credentials {
  155. username System.getenv('ARTIFACTORY_USER')
  156. password System.getenv('ARTIFACTORY_PASS')
  157. }
  158. }
  159. }
  160. }
  161. task sourceJar(type: Jar, dependsOn: 'classes') {
  162. from sourceSets.main.allSource
  163. classifier = 'sources'
  164. }