Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.12 KB | None | 0 0
  1. buildscript {
  2. repositories {
  3. maven { url = 'https://files.minecraftforge.net/maven' }
  4. jcenter()
  5. mavenCentral()
  6. }
  7. dependencies {
  8. classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
  9. classpath 'net.dv8tion:JDA:3.8.3_464'
  10. classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.4'
  11. }
  12. }
  13.  
  14. apply plugin: 'java'
  15. apply plugin: 'net.minecraftforge.gradle'
  16. apply plugin: "com.github.johnrengelman.shadow"
  17.  
  18. def mcVersion = '1.14.3'
  19. def modVersion = '1.0.0'
  20.  
  21. version = mcVersion + '_' + modVersion
  22. group = "com.tempname.mod"
  23. archivesBaseName = "tempname"
  24.  
  25. sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
  26.  
  27. minecraft {
  28. // The mappings can be changed at any time, and must be in the following format.
  29. // snapshot_YYYYMMDD Snapshot are built nightly.
  30. // stable_# Stables are built at the discretion of the MCP team.
  31. // Use non-default mappings at your own risk. they may not always work.
  32. // Simply re-run your setup task after changing the mappings to update your workspace.
  33. mappings channel: 'snapshot', version: '20190621-1.14.2'
  34. // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
  35.  
  36. // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
  37.  
  38. // Default run configurations.
  39. // These can be tweaked, removed, or duplicated as needed.
  40. runs {
  41. client {
  42. workingDirectory project.file('run')
  43.  
  44. // Recommended logging data for a userdev environment
  45. property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
  46.  
  47. // Recommended logging level for the console
  48. property 'forge.logging.console.level', 'debug'
  49.  
  50. mods {
  51. esu {
  52. source sourceSets.main
  53. }
  54. }
  55. }
  56.  
  57. server {
  58. workingDirectory project.file('run')
  59.  
  60. // Recommended logging data for a userdev environment
  61. property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
  62.  
  63. // Recommended logging level for the console
  64. property 'forge.logging.console.level', 'debug'
  65.  
  66. mods {
  67. esu {
  68. source sourceSets.main
  69. }
  70. }
  71. }
  72.  
  73. data {
  74. workingDirectory project.file('run')
  75.  
  76. // Recommended logging data for a userdev environment
  77. property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
  78.  
  79. // Recommended logging level for the console
  80. property 'forge.logging.console.level', 'debug'
  81.  
  82. args '--mod', 'esu', '--all', '--output', file('src/generated/resources/')
  83.  
  84. mods {
  85. esu {
  86. source sourceSets.main
  87. }
  88. }
  89. }
  90. }
  91. }
  92.  
  93. repositories {
  94. jcenter()
  95. }
  96.  
  97. dependencies {
  98. minecraft 'net.minecraftforge:forge:1.14.3-27.0.12'
  99.  
  100. shadow('net.dv8tion:JDA:3.8.3_464') {
  101. exclude module: 'opus-java'
  102. }
  103.  
  104. compile 'org.jetbrains:annotations:15.0'
  105. }
  106.  
  107. shadowJar {
  108. classifier = ""
  109. relocate "com.iwebpp.crypto", "com.tempname.discord.repack.com.iwebpp.crypto"
  110. relocate 'org.apache.commons.collections4', 'com.tempname.discord.repack.org.apache.commons.collections4'
  111. relocate 'gnu.trove', 'com.tempname.discord.repack.gnu.trove'
  112. relocate "com.neovisionaries.ws.client", "com.tempname.discord.repack.com.neovisionaries.ws.client"
  113. relocate "com.iwebpp.crypto", "com.tempname.discord.repack.com.iwebpp.crypto"
  114. relocate "net.dv8tion.jda", "com.tempname.discord.repack.net.dv8tion.jda"
  115. relocate "org.json", "com.tempname.discord.repack.org.json"
  116. relocate "okio", "com.tempname.repack.discord.okio"
  117. relocate "okhttp3", "com.tempname.discord.repack.okhttp3"
  118. relocate "org.slf4j", "com.tempname.discord.repack.org.slf4j"
  119. relocate "org.apache.http", "com.tempname.discord.repack.org.apache.http"
  120. relocate "org.apache.commons.logging", "com.tempname.discord.repack.org.apache.commons.logging"
  121.  
  122. configurations = [project.configurations.shadow]
  123. dependencies{
  124. exclude(dependency('org.jetbrains:annotations'))
  125. }
  126. }
  127.  
  128. processResources {
  129. // this will ensure that this task is redone when the versions change.
  130. inputs.property "version", project.version
  131. inputs.property "mcversion", mcVersion
  132.  
  133. // replace stuff in mcmod.info, nothing else
  134. from(sourceSets.main.resources.srcDirs) {
  135. include 'mcmod.info'
  136.  
  137. // replace version and mcversion
  138. expand 'version': modVersion, 'mcversion': mcVersion
  139. }
  140.  
  141. // copy everything else, that's not the mcmod.info
  142. from(sourceSets.main.resources.srcDirs) {
  143. exclude 'mcmod.info'
  144. }
  145.  
  146. }
  147.  
  148. reobf {
  149. shadowJar {
  150. dependsOn createMcpToSrg
  151. mappings = createMcpToSrg.output
  152. }
  153. }
  154.  
  155. artifacts {
  156. archives shadowJar
  157. }
  158.  
  159. build.dependsOn(shadowJar)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement