Advertisement
Guest User

Untitled

a guest
Jun 25th, 2023
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.44 KB | None | 0 0
  1. plugins {
  2. id 'eclipse'
  3. id 'maven-publish'
  4. id 'net.minecraftforge.gradle' version '5.1.+'
  5. }
  6.  
  7. version = '1.0'
  8. group = 'com.christianbutnot.royalcrowns' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
  9. archivesBaseName = 'royalcrowns'
  10.  
  11. // Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
  12. java.toolchain.languageVersion = JavaLanguageVersion.of(17)
  13.  
  14. println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
  15. minecraft {
  16. // The mappings can be changed at any time and must be in the following format.
  17. // Channel: Version:
  18. // official MCVersion Official field/method names from Mojang mapping files
  19. // parchment YYYY.MM.DD-MCVersion Open community-sourced parameter names and javadocs layered on top of official
  20. //
  21. // You must be aware of the Mojang license when using the 'official' or 'parchment' mappings.
  22. // See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
  23. //
  24. // Parchment is an unofficial project maintained by ParchmentMC, separate from MinecraftForge
  25. // Additional setup is needed to use their mappings: https://github.com/ParchmentMC/Parchment/wiki/Getting-Started
  26. //
  27. // Use non-default mappings at your own risk. They may not always work.
  28. // Simply re-run your setup task after changing the mappings to update your workspace.
  29. mappings channel: 'official', version: '1.19.2'
  30.  
  31. // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Currently, this location cannot be changed from the default.
  32.  
  33. // Default run configurations.
  34. // These can be tweaked, removed, or duplicated as needed.
  35. runs {
  36. client {
  37. workingDirectory project.file('run')
  38.  
  39. // Recommended logging data for a userdev environment
  40. // The markers can be added/remove as needed separated by commas.
  41. // "SCAN": For mods scan.
  42. // "REGISTRIES": For firing of registry events.
  43. // "REGISTRYDUMP": For getting the contents of all registries.
  44. property 'forge.logging.markers', 'REGISTRIES'
  45.  
  46. // Recommended logging level for the console
  47. // You can set various levels here.
  48. // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
  49. property 'forge.logging.console.level', 'debug'
  50.  
  51. // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
  52. property 'forge.enabledGameTestNamespaces', 'royalcrowns'
  53.  
  54. mods {
  55. royalcrowns {
  56. source sourceSets.main
  57. }
  58. }
  59. }
  60.  
  61. server {
  62. workingDirectory project.file('run')
  63.  
  64. property 'forge.logging.markers', 'REGISTRIES'
  65.  
  66. property 'forge.logging.console.level', 'debug'
  67.  
  68. property 'forge.enabledGameTestNamespaces', 'royalcrowns'
  69.  
  70. mods {
  71. royalcrowns {
  72. source sourceSets.main
  73. }
  74. }
  75. }
  76.  
  77. // This run config launches GameTestServer and runs all registered gametests, then exits.
  78. // By default, the server will crash when no gametests are provided.
  79. // The gametest system is also enabled by default for other run configs under the /test command.
  80. gameTestServer {
  81. workingDirectory project.file('run')
  82.  
  83. property 'forge.logging.markers', 'REGISTRIES'
  84.  
  85. property 'forge.logging.console.level', 'debug'
  86.  
  87. property 'forge.enabledGameTestNamespaces', 'royalcrowns'
  88.  
  89. mods {
  90. royalcrowns {
  91. source sourceSets.main
  92. }
  93. }
  94. }
  95.  
  96. data {
  97. workingDirectory project.file('run')
  98.  
  99. property 'forge.logging.markers', 'REGISTRIES'
  100.  
  101. property 'forge.logging.console.level', 'debug'
  102.  
  103. // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
  104. args '--mod', 'royalcrowns', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
  105.  
  106. mods {
  107. royalcrowns {
  108. source sourceSets.main
  109. }
  110. }
  111. }
  112. }
  113. }
  114.  
  115. // Include resources generated by data generators.
  116. sourceSets.main.resources { srcDir 'src/generated/resources' }
  117.  
  118. repositories {
  119. // Put repositories for dependencies here
  120. // ForgeGradle automatically adds the Forge maven and Maven Central for you
  121.  
  122. // If you have mod jar dependencies in ./libs, you can declare them as a repository like so:
  123. // flatDir {
  124. // dir 'libs'
  125. // }
  126. }
  127.  
  128. dependencies {
  129. // Specify the version of Minecraft to use. If this is any group other than 'net.minecraft', it is assumed
  130. // that the dep is a ForgeGradle 'patcher' dependency, and its patches will be applied.
  131. // The userdev artifact is a special name and will get all sorts of transformations applied to it.
  132. minecraft 'net.minecraftforge:forge:1.19.2-43.2.0'
  133.  
  134. // Real mod deobf dependency examples - these get remapped to your current mappings
  135. // compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency
  136. // runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") // Adds the full JEI mod as a runtime dependency
  137. // implementation fg.deobf("com.tterrag.registrate:Registrate:MC${mc_version}-${registrate_version}") // Adds registrate as a dependency
  138.  
  139. // Examples using mod jars from ./libs
  140. // implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}")
  141.  
  142. // For more info...
  143. // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
  144. // http://www.gradle.org/docs/current/userguide/dependency_management.html
  145. }
  146.  
  147. // Example for how to get properties into the manifest for reading at runtime.
  148. jar {
  149. manifest {
  150. attributes([
  151. "Specification-Title" : "royalcrowns",
  152. "Specification-Vendor" : "progressionisticcreations",
  153. "Specification-Version" : "1", // We are version 1 of ourselves
  154. "Implementation-Title" : project.name,
  155. "Implementation-Version" : project.jar.archiveVersion,
  156. "Implementation-Vendor" : "progressionisticcreations",
  157. "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
  158. ])
  159. }
  160. }
  161.  
  162. // Example configuration to allow publishing using the maven-publish plugin
  163. // This is the preferred method to reobfuscate your jar file
  164. jar.finalizedBy('reobfJar')
  165. // 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
  166. // publish.dependsOn('reobfJar')
  167.  
  168. publishing {
  169. publications {
  170. mavenJava(MavenPublication) {
  171. artifact jar
  172. }
  173. }
  174. repositories {
  175. maven {
  176. url "file://${project.projectDir}/mcmodsrepo"
  177. }
  178. }
  179. }
  180.  
  181. tasks.withType(JavaCompile).configureEach {
  182. options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
  183. }
  184.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement