Advertisement
LouisSpielt

Untitled

Sep 20th, 2023
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.12 KB | None | 0 0
  1.  
  2. buildscript {
  3. repositories {
  4. maven {
  5. url "https://plugins.gradle.org/m2/"
  6. }
  7. }
  8. dependencies {
  9. classpath "com.github.johnrengelman:shadow:8+"
  10.  
  11. }
  12. }
  13.  
  14. plugins {
  15. id 'eclipse'
  16. id 'idea'
  17. id 'net.minecraftforge.gradle' version '[6.0,6.2)'
  18. id "com.github.johnrengelman.shadow" version "8.1.1" apply true
  19. }
  20.  
  21. group = mod_version
  22. version = mod_group_id
  23.  
  24. base {
  25. archivesName = mod_id
  26. }
  27.  
  28. java {
  29. toolchain.languageVersion = JavaLanguageVersion.of(17)
  30. }
  31.  
  32. minecraft {
  33.  
  34. mappings channel: mapping_channel, version: mapping_version
  35.  
  36. copyIdeResources = true
  37.  
  38.  
  39. runs {
  40.  
  41. configureEach {
  42. workingDirectory project.file('run')
  43.  
  44.  
  45. property 'forge.logging.markers', 'REGISTRIES'
  46.  
  47.  
  48. property 'forge.logging.console.level', 'debug'
  49.  
  50. mods {
  51. "${mod_id}" {
  52. source sourceSets.main
  53. }
  54. }
  55. }
  56.  
  57. client {
  58. property 'forge.enabledGameTestNamespaces', mod_id
  59. buildscript
  60. }
  61.  
  62. server {
  63. property 'forge.enabledGameTestNamespaces', mod_id
  64. args '--nogui'
  65. }
  66.  
  67.  
  68. gameTestServer {
  69. property 'forge.enabledGameTestNamespaces', mod_id
  70. }
  71.  
  72. data {
  73. workingDirectory project.file('run-data')
  74.  
  75. args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
  76. }
  77. }
  78. }
  79.  
  80. sourceSets.main.resources { srcDir 'src/generated/resources' }
  81.  
  82.  
  83. dependencies {
  84. minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
  85. implementation 'mysql:mysql-connector-java:8.0.33'
  86. }
  87. tasks.named('processResources', ProcessResources).configure {
  88. var replaceProperties = [
  89. minecraft_version : minecraft_version, minecraft_version_range: minecraft_version_range,
  90. forge_version : forge_version, forge_version_range: forge_version_range,
  91. loader_version_range: loader_version_range,
  92. mod_id : mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version,
  93. mod_authors : mod_authors, mod_description: mod_description,
  94. ]
  95.  
  96. inputs.properties replaceProperties
  97.  
  98. filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) {
  99. expand replaceProperties + [project: project]
  100. }
  101. }
  102.  
  103. tasks.named('jar', Jar).configure {
  104. manifest {
  105. attributes([
  106. "Specification-Title" : mod_id,
  107. "Specification-Vendor" : mod_authors,
  108. "Specification-Version" : "1",
  109. "Implementation-Title" : project.name,
  110. "Implementation-Version" : project.jar.archiveVersion,
  111. "Implementation-Vendor" : mod_authors,
  112. "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
  113. ])
  114. }
  115. finalizedBy 'reobfJar'
  116. }
  117.  
  118. tasks.withType(JavaCompile).configureEach {
  119. options.encoding = 'UTF-8'
  120. }
  121.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement