Advertisement
GeradesoLukas

Untitled

Oct 4th, 2022
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.86 KB | None | 0 0
  1. buildscript {
  2. repositories {
  3. // These repositories are only for Gradle plugins, put any other repositories in the repository block further below
  4. maven { url = 'https://maven.minecraftforge.net' }
  5. maven { url = 'https://maven.parchmentmc.org' }
  6. maven { url = 'https://repo.spongepowered.org/maven' }
  7.  
  8. mavenCentral()
  9. }
  10. configurations {
  11. shade
  12. implementation.extendsFrom shade
  13. }
  14. dependencies {
  15. classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
  16. classpath 'org.parchmentmc:librarian:1.+'
  17. classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT'
  18. }
  19. }
  20. // Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
  21. plugins {
  22. id 'eclipse'
  23. id 'maven-publish'
  24. id 'com.github.johnrengelman.shadow' version '7.1.2'
  25. }
  26. apply plugin: 'net.minecraftforge.gradle'
  27. apply plugin: 'org.parchmentmc.librarian.forgegradle'
  28. apply plugin: 'org.spongepowered.mixin'
  29.  
  30.  
  31. version = '1.18.2-1.3.5'
  32. group = 'net.geradesolukas.weaponleveling' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
  33. archivesBaseName = 'weaponleveling'
  34.  
  35. // Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
  36. java.toolchain.languageVersion = JavaLanguageVersion.of(17)
  37.  
  38. println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
  39. minecraft {
  40. // The mappings can be changed at any time and must be in the following format.
  41. // Channel: Version:
  42. // official MCVersion Official field/method names from Mojang mapping files
  43. // parchment YYYY.MM.DD-MCVersion Open community-sourced parameter names and javadocs layered on top of official
  44. //
  45. // You must be aware of the Mojang license when using the 'official' or 'parchment' mappings.
  46. // See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
  47. //
  48. // Parchment is an unofficial project maintained by ParchmentMC, separate from MinecraftForge
  49. // Additional setup is needed to use their mappings: https://github.com/ParchmentMC/Parchment/wiki/Getting-Started
  50. //
  51. // Use non-default mappings at your own risk. They may not always work.
  52. // Simply re-run your setup task after changing the mappings to update your workspace.
  53. mappings channel: 'parchment', version: '2022.09.04-1.18.2'
  54.  
  55. // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Currently, this location cannot be changed from the default.
  56.  
  57. // Default run configurations.
  58. // These can be tweaked, removed, or duplicated as needed.
  59. runs {
  60. client {
  61. workingDirectory project.file('run')
  62.  
  63. // Recommended logging data for a userdev environment
  64. // The markers can be added/remove as needed separated by commas.
  65. // "SCAN": For mods scan.
  66. // "REGISTRIES": For firing of registry events.
  67. // "REGISTRYDUMP": For getting the contents of all registries.
  68. property 'forge.logging.markers', 'REGISTRIES'
  69.  
  70. // Recommended logging level for the console
  71. // You can set various levels here.
  72. // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
  73. property 'forge.logging.console.level', 'debug'
  74.  
  75. // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
  76. property 'forge.enabledGameTestNamespaces', 'weaponleveling'
  77. arg "-mixin.config=weaponleveling.mixin.json"
  78.  
  79. mods {
  80. weaponleveling {
  81. source sourceSets.main
  82. }
  83. }
  84. }
  85.  
  86. server {
  87. workingDirectory project.file('run')
  88.  
  89. property 'forge.logging.markers', 'REGISTRIES'
  90.  
  91. property 'forge.logging.console.level', 'debug'
  92.  
  93. // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
  94. property 'forge.enabledGameTestNamespaces', 'weaponleveling'
  95. arg "-mixin.config=weaponleveling.mixin.json"
  96.  
  97. mods {
  98. weaponleveling {
  99. source sourceSets.main
  100. }
  101. }
  102. }
  103.  
  104. // This run config launches GameTestServer and runs all registered gametests, then exits.
  105. // By default, the server will crash when no gametests are provided.
  106. // The gametest system is also enabled by default for other run configs under the /test command.
  107. gameTestServer {
  108. workingDirectory project.file('run')
  109.  
  110. // Recommended logging data for a userdev environment
  111. // The markers can be added/remove as needed separated by commas.
  112. // "SCAN": For mods scan.
  113. // "REGISTRIES": For firing of registry events.
  114. // "REGISTRYDUMP": For getting the contents of all registries.
  115. property 'forge.logging.markers', 'REGISTRIES'
  116.  
  117. // Recommended logging level for the console
  118. // You can set various levels here.
  119. // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
  120. property 'forge.logging.console.level', 'debug'
  121.  
  122. // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
  123. property 'forge.enabledGameTestNamespaces', 'weaponleveling'
  124. arg "-mixin.config=weaponleveling.mixin.json"
  125.  
  126. mods {
  127. weaponleveling {
  128. source sourceSets.main
  129. }
  130. }
  131. }
  132.  
  133. data {
  134. workingDirectory project.file('run')
  135.  
  136. property 'forge.logging.markers', 'REGISTRIES'
  137.  
  138. property 'forge.logging.console.level', 'debug'
  139.  
  140. // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
  141. args '--mod', 'weaponleveling', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
  142.  
  143. mods {
  144. weaponleveling {
  145. source sourceSets.main
  146. }
  147. }
  148. }
  149. }
  150. }
  151.  
  152. // Include resources generated by data generators.
  153. sourceSets.main.resources { srcDir 'src/generated/resources' }
  154.  
  155. repositories {
  156. maven { url = 'https://jitpack.io' }
  157. // Put repositories for dependencies here
  158. // ForgeGradle automatically adds the Forge maven and Maven Central for you
  159.  
  160. // If you have mod jar dependencies in ./libs, you can declare them as a repository like so:
  161. // flatDir {
  162. // dir 'libs'
  163. // }
  164. }
  165.  
  166. repositories {
  167. maven {
  168. url "https://cursemaven.com"
  169. content {
  170. includeGroup "curse.maven"
  171. }
  172. }
  173. }
  174.  
  175. dependencies {
  176. // Specify the version of Minecraft to use. If this is any group other than 'net.minecraft', it is assumed
  177. // that the dep is a ForgeGradle 'patcher' dependency, and its patches will be applied.
  178. // The userdev artifact is a special name and will get all sorts of transformations applied to it.
  179. minecraft 'net.minecraftforge:forge:1.18.2-40.1.54'
  180. minecraftLibrary(annotationProcessor(shade("com.github.LlamaLad7:MixinExtras:0.1.0-rc3")))
  181. annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
  182.  
  183.  
  184. compileOnly fg.deobf("curse.maven:tetra-289712:3844400") //Tetra
  185. compileOnly fg.deobf("curse.maven:mutil-351914:3788376") //mutil
  186.  
  187. compileOnly fg.deobf("curse.maven:tinkers-74072:3998764") //Tinkers
  188. compileOnly fg.deobf("curse.maven:mantle-74924:3829975") //Mantle
  189.  
  190. compileOnly fg.deobf("curse.maven:bettercombat-639842:4015126") //Better Combat
  191. compileOnly fg.deobf("curse.maven:playeranim-658587:3955875") //PlayerAnimator
  192.  
  193.  
  194.  
  195.  
  196. implementation fg.deobf("curse.maven:clothconfig-348521:3972426") //ClothConfigApi
  197.  
  198. implementation fg.deobf("curse.maven:debugify-596224:3812301") //Debugify
  199.  
  200. // Real mod deobf dependency examples - these get remapped to your current mappings
  201. // compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency
  202. // runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") // Adds the full JEI mod as a runtime dependency
  203. // implementation fg.deobf("com.tterrag.registrate:Registrate:MC${mc_version}-${registrate_version}") // Adds registrate as a dependency
  204.  
  205. // Examples using mod jars from ./libs
  206. // implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}")
  207.  
  208. // For more info...
  209. // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
  210. // http://www.gradle.org/docs/current/userguide/dependency_management.html
  211. }
  212.  
  213. // Example for how to get properties into the manifest for reading at runtime.
  214. jar {
  215. archiveClassifier = 'slim'
  216. manifest {
  217. attributes([
  218. "Specification-Title" : "weaponleveling",
  219. "Specification-Vendor" : "geradesolukas",
  220. "Specification-Version" : "1", // We are version 1 of ourselves
  221. "Implementation-Title" : project.name,
  222. "Implementation-Version" : project.jar.archiveVersion,
  223. "Implementation-Vendor" : "geradesolukas",
  224. "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
  225. "TweakClass": "org.spongepowered.asm.launch.MixinTweaker",
  226. "TweakOrder": 0,
  227. "MixinConfigs" : "weaponleveling.mixin.json"
  228. ])
  229. }
  230. }
  231. shadowJar {
  232. archiveClassifier = ''
  233. configurations = [project.configurations.shade]
  234. relocate("com.llamalad7.mixinextras", "net.geradesolukas.mixinextras")
  235. finalizedBy 'reobfShadowJar'
  236. }
  237.  
  238. assemble.dependsOn shadowJar
  239.  
  240. reobf {
  241. shadowJar {}
  242. }
  243.  
  244. // Example configuration to allow publishing using the maven-publish plugin
  245. // This is the preferred method to reobfuscate your jar file
  246. jar.finalizedBy('reobfJar')
  247. // However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
  248. // publish.dependsOn('reobfJar')
  249.  
  250. publishing {
  251. publications {
  252. mavenJava(MavenPublication) {
  253. artifact jar
  254. }
  255. }
  256. repositories {
  257. maven {
  258. url "file://${project.projectDir}/mcmodsrepo"
  259. }
  260. }
  261. }
  262.  
  263. tasks.withType(JavaCompile).configureEach {
  264. options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
  265. }
  266.  
  267. mixin {
  268. add sourceSets.main, "weaponleveling.mixin-refmap.json"
  269. config 'weaponleveling.mixin.json'
  270. }
  271.  
  272.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement