Advertisement
Scouter456

Untitled

Mar 17th, 2023
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 7.57 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/repository/maven-public' }
  7.  
  8.         mavenCentral()
  9.     }
  10.     dependencies {
  11.         classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
  12.         classpath 'org.parchmentmc:librarian:1.+'
  13.         classpath "org.spongepowered:mixingradle:0.7-SNAPSHOT"
  14.  
  15.     }
  16. }
  17. // Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
  18. plugins {
  19.     id 'eclipse'
  20.     id 'maven-publish'
  21. }
  22. apply plugin: 'net.minecraftforge.gradle'
  23. apply plugin: 'org.parchmentmc.librarian.forgegradle'
  24. apply plugin: 'org.spongepowered.mixin'
  25.  
  26.  
  27. version = '2.0.2-1.18.2'
  28. group = 'com.scouter.netherdepthsupgrade' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
  29. archivesBaseName = 'netherdepthsupgrade'
  30.  
  31. // Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
  32. java.toolchain.languageVersion = JavaLanguageVersion.of(17)
  33.  
  34. println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
  35. minecraft {
  36.     mappings channel: 'parchment', version: '2022.05.02-1.18.2'
  37.  
  38.     accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Currently, this location cannot be changed from the default.
  39.  
  40.     runs {
  41.         client {
  42.             workingDirectory project.file('run')
  43.  
  44.             arg '-mixin.config=netherdepthsupgrade.mixins.json'
  45.             property 'forge.logging.markers', 'REGISTRIES'
  46.             property 'forge.logging.console.level', 'debug'
  47.             property 'forge.enabledGameTestNamespaces', 'netherdepthsupgrade'
  48.  
  49.             mods {
  50.                 netherdepthsupgrade {
  51.                     source sourceSets.main
  52.                 }
  53.             }
  54.         }
  55.  
  56.         server {
  57.             workingDirectory project.file('run')
  58.             arg "-mixin.config=netherdepthsupgrade.mixins.json"
  59.             property 'forge.logging.markers', 'REGISTRIES'
  60.             property 'forge.logging.console.level', 'debug'
  61.             property 'forge.enabledGameTestNamespaces', 'netherdepthsupgrade'
  62.  
  63.             mods {
  64.                 netherdepthsupgrade {
  65.                     source sourceSets.main
  66.                 }
  67.             }
  68.         }
  69.  
  70.         gameTestServer {
  71.             workingDirectory project.file('run')
  72.             property 'forge.logging.markers', 'REGISTRIES'
  73.             property 'forge.logging.console.level', 'debug'
  74.             property 'forge.enabledGameTestNamespaces', 'netherdepthsupgrade'
  75.  
  76.             mods {
  77.                 netherdepthsupgrade {
  78.                     source sourceSets.main
  79.                 }
  80.             }
  81.         }
  82.  
  83.         data {
  84.             workingDirectory project.file('run')
  85.  
  86.             property 'forge.logging.markers', 'REGISTRIES'
  87.  
  88.             property 'forge.logging.console.level', 'debug'
  89.  
  90.             // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
  91.             args '--mod', 'netherdepthsupgrade', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
  92.  
  93.             mods {
  94.                 netherdepthsupgrade {
  95.                     source sourceSets.main
  96.                 }
  97.             }
  98.         }
  99.     }
  100. }
  101.  
  102. // Include resources generated by data generators.
  103. sourceSets.main.resources { srcDir 'src/generated/resources' }
  104.  
  105. //mixin {
  106. //    add sourceSets.main, "netherdepthsupgrade.refmap.json"
  107. //}
  108.  
  109. sourceSets {
  110.     main {
  111.         ext.refMap = "netherdepthsupgrade.refmap.json"
  112.     }
  113. }
  114.  
  115. repositories {
  116.     maven { url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/' }
  117.     // Put repositories for dependencies here
  118.     // ForgeGradle automatically adds the Forge maven and Maven Central for you
  119.  
  120.     maven {// location of the maven that hosts JEI files
  121.         name = "Progwml6 maven"
  122.         url = "https://dvs1.progwml6.com/files/maven/"
  123.     }
  124.     maven {
  125.         // location of a maven mirror for JEI files, as a fallback
  126.         name = "ModMaven"
  127.         url = "https://modmaven.dev"
  128.     }
  129.  
  130.     maven {url 'https://www.cursemaven.com'}
  131.  
  132.     // If you have mod jar dependencies in ./libs, you can declare them as a repository like so:
  133.     // flatDir {
  134.     //     dir 'libs'
  135.     // }
  136. }
  137.  
  138. dependencies {
  139.     // Specify the version of Minecraft to use. If this is any group other than 'net.minecraft', it is assumed
  140.     // that the dep is a ForgeGradle 'patcher' dependency, and its patches will be applied.
  141.     // The userdev artifact is a special name and will get all sorts of transformations applied to it.
  142.     minecraft 'net.minecraftforge:forge:1.18.2-40.1.92'
  143.     implementation fg.deobf('software.bernie.geckolib:geckolib-forge-1.18:3.0.57')
  144.     compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api")
  145.     runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}")
  146.     // Real mod deobf dependency examples - these get remapped to your current mappings
  147.     // compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency
  148.     // runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") // Adds the full JEI mod as a runtime dependency
  149.     // implementation fg.deobf("com.tterrag.registrate:Registrate:MC${mc_version}-${registrate_version}") // Adds registrate as a dependency
  150.     implementation fg.deobf("curse.maven:farmersdelight-398521:3999153")
  151.     compileOnly fg.deobf("curse.maven:farmersdelight-398521:3999153")
  152.  
  153.     // Examples using mod jars from ./libs
  154.     // implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}")
  155.  
  156.     // For more info...
  157.     // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
  158.     // http://www.gradle.org/docs/current/userguide/dependency_management.html
  159.  
  160. }
  161.  
  162. // Example for how to get properties into the manifest for reading at runtime.
  163. jar {
  164.     manifest {
  165.         attributes([
  166.                 "Specification-Title"     : "netherdepthsupgrade",
  167.                 "Specification-Vendor"    : "scouter456",
  168.                 "Specification-Version"   : "1", // We are version 1 of ourselves
  169.                 "Implementation-Title"    : project.name,
  170.                 "Implementation-Version"  : project.jar.archiveVersion,
  171.                 "Implementation-Vendor"   : "scouter456",
  172.                 "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
  173.                 "MixinConfigs"            : "netherdepthsupgrade.mixins.json",
  174.         ])
  175.     }
  176.  
  177. }
  178.  
  179. // Example configuration to allow publishing using the maven-publish plugin
  180. // This is the preferred method to reobfuscate your jar file
  181. jar.finalizedBy('reobfJar')
  182. // 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
  183. // publish.dependsOn('reobfJar')
  184.  
  185. publishing {
  186.     publications {
  187.         mavenJava(MavenPublication) {
  188.             artifact jar
  189.         }
  190.     }
  191.     repositories {
  192.         maven {
  193.             url "file://${project.projectDir}/mcmodsrepo"
  194.         }
  195.     }
  196. }
  197.  
  198. tasks.withType(JavaCompile).configureEach {
  199.     options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
  200. }
  201.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement