167 lines
5.4 KiB
Groovy
167 lines
5.4 KiB
Groovy
plugins {
|
|
id 'eclipse'
|
|
id 'maven-publish'
|
|
id 'net.minecraftforge.gradle' version '5.1.+'
|
|
}
|
|
|
|
version = mod_version
|
|
group = 'vip.fubuki.playersync' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
|
archivesBaseName = 'playersync'
|
|
|
|
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
|
|
|
|
println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
|
|
minecraft {
|
|
|
|
mappings channel: 'official', version: '1.20.1'
|
|
|
|
//accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Currently, this location cannot be changed from the default.
|
|
|
|
runs {
|
|
client {
|
|
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', 'playersync'
|
|
|
|
mods {
|
|
playsersync {
|
|
source sourceSets.main
|
|
}
|
|
}
|
|
}
|
|
|
|
server {
|
|
workingDirectory project.file('run')
|
|
|
|
property 'forge.logging.markers', 'REGISTRIES'
|
|
|
|
property 'forge.logging.console.level', 'debug'
|
|
|
|
property 'forge.enabledGameTestNamespaces', 'playersync'
|
|
|
|
mods {
|
|
playersync {
|
|
source sourceSets.main
|
|
}
|
|
}
|
|
}
|
|
|
|
// This run config launches GameTestServer and runs all registered gametests, then exits.
|
|
// By default, the server will crash when no gametests are provided.
|
|
// The gametest system is also enabled by default for other run configs under the /test command.
|
|
gameTestServer {
|
|
workingDirectory project.file('run')
|
|
|
|
property 'forge.logging.markers', 'REGISTRIES'
|
|
|
|
property 'forge.logging.console.level', 'debug'
|
|
|
|
property 'forge.enabledGameTestNamespaces', 'playersync'
|
|
|
|
property 'mixin.env.remapRefMap', 'true'
|
|
property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
|
|
|
|
mods {
|
|
playersync {
|
|
source sourceSets.main
|
|
}
|
|
}
|
|
}
|
|
|
|
data {
|
|
workingDirectory project.file('run')
|
|
|
|
property 'forge.logging.markers', 'REGISTRIES'
|
|
|
|
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', 'playersync', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
|
|
|
|
mods {
|
|
playersync{
|
|
source sourceSets.main
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
sourceSets.main.resources { srcDir 'src/generated/resources' }
|
|
|
|
repositories {
|
|
maven {
|
|
url = "https://maven.theillusivec4.top/"
|
|
}
|
|
|
|
maven {
|
|
url "https://cursemaven.com"
|
|
content {
|
|
includeGroup "curse.maven"
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
minecraft 'net.minecraftforge:forge:1.20.1-47.1.0'
|
|
|
|
jarJar("curse.maven:MySQL-561280:3685108") {
|
|
jarJar.ranged(it, '[1.0,)')
|
|
}
|
|
|
|
runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:5.7.2+1.20.1")
|
|
compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:5.7.2+1.20.1:api")
|
|
implementation fg.deobf("curse.maven:MySQL-561280:3685108")
|
|
}
|
|
|
|
// Example for how to get properties into the manifest for reading at runtime.
|
|
jar {
|
|
manifest {
|
|
attributes([
|
|
"Specification-Title" : "playersync",
|
|
"Specification-Vendor" : "examplemodsareus",
|
|
"Specification-Version" : "1", // We are version 1 of ourselves
|
|
"Implementation-Title" : project.name,
|
|
"Implementation-Version" : project.jar.archiveVersion,
|
|
"Implementation-Vendor" : "examplemodsareus",
|
|
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
|
|
])
|
|
}
|
|
}
|
|
|
|
// Example configuration to allow publishing using the maven-publish plugin
|
|
// This is the preferred method to reobfuscate your jar file
|
|
jar.finalizedBy('reobfJar')
|
|
// 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
|
|
// publish.dependsOn('reobfJar')
|
|
|
|
publishing {
|
|
publications {
|
|
mavenJava(MavenPublication) {
|
|
artifact jar
|
|
}
|
|
}
|
|
repositories {
|
|
maven {
|
|
url "file://${project.projectDir}/mcmodsrepo"
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.withType(JavaCompile).configureEach {
|
|
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
|
|
}
|