Advertisement
Scouter456

Untitled

Jul 24th, 2023
1,123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 10.39 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.+'
  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. version = '1.2.1-1.19.2'
  27. group = 'com.scouter.enderquatic' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
  28. archivesBaseName = 'enderquatic'
  29.  
  30. // Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
  31. java.toolchain.languageVersion = JavaLanguageVersion.of(17)
  32.  
  33. println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
  34. minecraft {
  35.     // The mappings can be changed at any time and must be in the following format.
  36.     // Channel:   Version:
  37.     // official   MCVersion             Official field/method names from Mojang mapping files
  38.     // parchment  YYYY.MM.DD-MCVersion  Open community-sourced parameter names and javadocs layered on top of official
  39.     //
  40.     // You must be aware of the Mojang license when using the 'official' or 'parchment' mappings.
  41.     // See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
  42.     //
  43.     // Parchment is an unofficial project maintained by ParchmentMC, separate from MinecraftForge
  44.     // Additional setup is needed to use their mappings: https://github.com/ParchmentMC/Parchment/wiki/Getting-Started
  45.     //
  46.     // Use non-default mappings at your own risk. They may not always work.
  47.     // Simply re-run your setup task after changing the mappings to update your workspace.
  48.     mappings channel: 'parchment', version: '2022.08.14-1.19.2'
  49.  
  50.     accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
  51.     // Currently, this location cannot be changed from the default.
  52.  
  53.     // Default run configurations.
  54.     // These can be tweaked, removed, or duplicated as needed.
  55.     runs {
  56.         client {
  57.             workingDirectory project.file('run')
  58.  
  59.             arg '-mixin.config=enderquatic.mixins.json'
  60.             // Recommended logging data for a userdev environment
  61.             // The markers can be added/remove as needed separated by commas.
  62.             // "SCAN": For mods scan.
  63.             // "REGISTRIES": For firing of registry events.
  64.             // "REGISTRYDUMP": For getting the contents of all registries.
  65.             property 'forge.logging.markers', 'REGISTRIES'
  66.  
  67.             // Recommended logging level for the console
  68.             // You can set various levels here.
  69.             // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
  70.             property 'forge.logging.console.level', 'debug'
  71.  
  72.             // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
  73.             property 'forge.enabledGameTestNamespaces', 'enderquatic'
  74.  
  75.             mods {
  76.                 enderquatic {
  77.                     source sourceSets.main
  78.                 }
  79.             }
  80.         }
  81.  
  82.         server {
  83.             workingDirectory project.file('run')
  84.             arg "-mixin.config=enderquatic.mixins.json"
  85.  
  86.             property 'forge.logging.markers', 'REGISTRIES'
  87.  
  88.             property 'forge.logging.console.level', 'debug'
  89.  
  90.             // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
  91.             property 'forge.enabledGameTestNamespaces', 'enderquatic'
  92.  
  93.             mods {
  94.                 enderquatic {
  95.                     source sourceSets.main
  96.                 }
  97.             }
  98.         }
  99.  
  100.         // This run config launches GameTestServer and runs all registered gametests, then exits.
  101.         // By default, the server will crash when no gametests are provided.
  102.         // The gametest system is also enabled by default for other run configs under the /test command.
  103.         gameTestServer {
  104.             workingDirectory project.file('run')
  105.  
  106.             // Recommended logging data for a userdev environment
  107.             // The markers can be added/remove as needed separated by commas.
  108.             // "SCAN": For mods scan.
  109.             // "REGISTRIES": For firing of registry events.
  110.             // "REGISTRYDUMP": For getting the contents of all registries.
  111.             property 'forge.logging.markers', 'REGISTRIES'
  112.  
  113.             // Recommended logging level for the console
  114.             // You can set various levels here.
  115.             // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
  116.             property 'forge.logging.console.level', 'debug'
  117.  
  118.             // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
  119.             property 'forge.enabledGameTestNamespaces', 'enderquatic'
  120.  
  121.             mods {
  122.                 enderquatic {
  123.                     source sourceSets.main
  124.                 }
  125.             }
  126.         }
  127.  
  128.         data {
  129.             workingDirectory project.file('run')
  130.  
  131.             property 'forge.logging.markers', 'REGISTRIES'
  132.  
  133.             property 'forge.logging.console.level', 'debug'
  134.  
  135.             // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
  136.             args '--mod', 'enderquatic', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
  137.  
  138.             mods {
  139.                 enderquatic {
  140.                     source sourceSets.main
  141.                 }
  142.             }
  143.         }
  144.     }
  145. }
  146.  
  147. mixin {
  148.     add sourceSets.main, 'enderquatic.refmap.json'
  149.     config 'enderquatic.mixins.json'
  150. }
  151.  
  152. // Include resources generated by data generators.
  153. sourceSets.main.resources { srcDir 'src/generated/resources' }
  154.  
  155.  
  156.  
  157. repositories {
  158.     maven { url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/' }
  159.     maven { url "https://cursemaven.com" }
  160.  
  161.     maven {
  162.         url = "https://maven.jaackson.me"
  163.     }
  164.     // Put repositories for dependencies here
  165.     // ForgeGradle automatically adds the Forge maven and Maven Central for you
  166.  
  167.     maven {// location of the maven that hosts JEI files
  168.         name = "Progwml6 maven"
  169.         url = "https://dvs1.progwml6.com/files/maven/"
  170.     }
  171.     maven {
  172.         // location of a maven mirror for JEI files, as a fallback
  173.         name = "ModMaven"
  174.         url = "https://modmaven.dev"
  175.     }
  176.     // If you have mod jar dependencies in ./libs, you can declare them as a repository like so:
  177.     // flatDir {
  178.     //     dir 'libs'
  179.     // }
  180. }
  181.  
  182. dependencies {
  183.     // Specify the version of Minecraft to use. If this is any group other than 'net.minecraft', it is assumed
  184.     // that the dep is a ForgeGradle 'patcher' dependency, and its patches will be applied.
  185.     // The userdev artifact is a special name and will get all sorts of transformations applied to it.
  186.     minecraft 'net.minecraftforge:forge:1.19.2-43.2.21'
  187.     annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
  188.  
  189.     implementation fg.deobf('software.bernie.geckolib:geckolib-forge-1.19:3.1.38')
  190.  
  191.     compileOnly(fg.deobf("mezz.jei:jei-${mc_version}-common-api:${jei_version}"))
  192.     compileOnly(fg.deobf("mezz.jei:jei-${mc_version}-forge-api:${jei_version}"))
  193.     runtimeOnly(fg.deobf("mezz.jei:jei-${mc_version}-forge:${jei_version}"))
  194.     //implementation fg.deobf("com.github.glitchfiend:TerraBlender-forge:${mc_version}-${terrablender_version}")
  195.  
  196.     //implementation fg.deobf("curse.maven:smartbrainlib-661293:4124615")
  197.     //compileOnly fg.deobf("curse.maven:smartbrainlib-661293:4124615")
  198.     // Real mod deobf dependency examples - these get remapped to your current mappings
  199.     // compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency
  200.     // runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") // Adds the full JEI mod as a runtime dependency
  201.     // implementation fg.deobf("com.tterrag.registrate:Registrate:MC${mc_version}-${registrate_version}") // Adds registrate as a dependency
  202.  
  203.  
  204.     // Examples using mod jars from ./libs
  205.     // implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}")
  206.  
  207.     // For more info...
  208.     // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
  209.     // http://www.gradle.org/docs/current/userguide/dependency_management.html
  210.  
  211. }
  212.  
  213. // Example for how to get properties into the manifest for reading at runtime.
  214. jar {
  215.     manifest {
  216.         attributes([
  217.                 "Specification-Title"     : "enderquatic",
  218.                 "Specification-Vendor"    : "scouter456",
  219.                 "Specification-Version"   : "1", // We are version 1 of ourselves
  220.                 "Implementation-Title"    : project.name,
  221.                 "Implementation-Version"  : project.jar.archiveVersion,
  222.                 "Implementation-Vendor"   : "scouter456",
  223.                 "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
  224.                 "MixinConfigs"            : "enderquatic.mixins.json"
  225.  
  226.         ])
  227.     }
  228.  
  229. }
  230.  
  231. // Example configuration to allow publishing using the maven-publish plugin
  232. // This is the preferred method to reobfuscate your jar file
  233. jar.finalizedBy('reobfJar')
  234. // 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
  235. // publish.dependsOn('reobfJar')
  236.  
  237. publishing {
  238.     publications {
  239.         mavenJava(MavenPublication) {
  240.             artifact jar
  241.         }
  242.     }
  243.     repositories {
  244.         maven {
  245.             url "file://${project.projectDir}/mcmodsrepo"
  246.         }
  247.     }
  248. }
  249.  
  250. tasks.withType(JavaCompile).configureEach {
  251.     options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
  252. }
  253.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement