Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- buildscript {
- repositories {
- maven { url = 'https://maven.minecraftforge.net' }
- maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
- maven { url = 'https://maven.parchmentmc.org' }
- mavenCentral()
- }
- dependencies {
- classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
- classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT'
- classpath 'org.parchmentmc:librarian:1.+'
- }
- }
- plugins {
- id 'mms.java-conventions'
- }
- java{
- archivesBaseName = namePrefix + "forge"
- }
- apply plugin: 'net.minecraftforge.gradle'
- apply plugin: 'org.spongepowered.mixin'
- apply plugin: 'org.parchmentmc.librarian.forgegradle'
- minecraft {
- mappings channel: 'parchment', version: parchmentVersion + "-" + mcVersion
- // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
- runs {
- client {
- workingDirectory project.file('run')
- // Recommended logging data for a userdev environment
- // The markers can be added/removed as needed separated by commas.
- // "SCAN": For mods scan.
- // "REGISTRIES": For firing of registry events.
- // "REGISTRYDUMP": For getting the contents of all registries.
- property 'forge.logging.markers', 'REGISTRIES'
- // Recommended logging level for the console
- // You can set various levels here.
- // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
- property 'forge.logging.console.level', 'debug'
- property 'forge.enabledGameTestNamespaces', 'statistics'
- mods {
- statistics {
- source sourceSets.main
- }
- }
- }
- server {
- workingDirectory project.file('run')
- // Recommended logging data for a userdev environment
- // The markers can be added/removed as needed separated by commas.
- // "SCAN": For mods scan.
- // "REGISTRIES": For firing of registry events.
- // "REGISTRYDUMP": For getting the contents of all registries.
- property 'forge.logging.markers', 'REGISTRIES'
- // Recommended logging level for the console
- // You can set various levels here.
- // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
- property 'forge.logging.console.level', 'debug'
- property 'forge.enabledGameTestNamespaces', 'statistics'
- mods {
- statistics {
- source sourceSets.main
- }
- }
- }
- gameTestServer {
- workingDirectory project.file('run')
- // Recommended logging data for a userdev environment
- // The markers can be added/remove as needed separated by commas.
- // "SCAN": For mods scan.
- // "REGISTRIES": For firing of registry events.
- // "REGISTRYDUMP": For getting the contents of all registries.
- property 'forge.logging.markers', 'REGISTRIES'
- // Recommended logging level for the console
- // You can set various levels here.
- // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
- property 'forge.logging.console.level', 'debug'
- // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
- property 'forge.enabledGameTestNamespaces', 'statistics'
- mods {
- statistics {
- source sourceSets.main
- }
- }
- }
- data {
- workingDirectory project.file('run')
- // Recommended logging data for a userdev environment
- // The markers can be added/removed as needed separated by commas.
- // "SCAN": For mods scan.
- // "REGISTRIES": For firing of registry events.
- // "REGISTRYDUMP": For getting the contents of all registries.
- property 'forge.logging.markers', 'REGISTRIES'
- // Recommended logging level for the console
- // You can set various levels here.
- // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
- property 'forge.logging.console.level', 'debug'
- // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
- args '--mod', 'statistics', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
- mods {
- statistics {
- source sourceSets.main
- }
- }
- }
- }
- }
- mixin {
- add sourceSets.main, "statistics.refmap.json"
- config "statistics.mixins.json"
- }
- // Include resources generated by data generators.
- sourceSets.main.resources { srcDir 'src/generated/resources' }
- repositories {
- // If you have mod jar dependencies in ./libs, you can declare them as a repository like so:
- // flatDir {
- // dir 'libs'
- // }
- }
- dependencies {
- minecraft 'net.minecraftforge:forge:' + mcVersion + '-' + forgeVersion
- annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
- }
- // Example for how to get properties into the manifest for reading at runtime.
- jar {
- manifest {
- attributes([
- "Specification-Title" : "statistics",
- "Specification-Vendor" : "MrProfessor",
- "Specification-Version" : "1", // We are version 1 of ourselves
- "Implementation-Title" : project.name,
- "Implementation-Version" : project.jar.archiveVersion,
- "Implementation-Vendor" : "MrProfessor",
- "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
- ])
- }
- }
- def replaceResources = tasks.register("replaceResources", Copy) {
- it.outputs.upToDateWhen { false }
- //Copy it into the build dir
- it.from(sourceSets.main.resources) {
- include "META-INF/mods.toml"
- expand 'modVersion': "${project.version}"
- }
- it.into "$buildDir/resources/main/"
- }
- processResources {
- duplicatesStrategy(DuplicatesStrategy.FAIL)
- exclude('META-INF/mods.toml')
- configure { finalizedBy(replaceResources) }
- }
- classes.configure {
- dependsOn(replaceResources)
- }
- assemble.dependsOn('reobfJar')
Advertisement
Add Comment
Please, Sign In to add comment