190 lines
6.1 KiB
Groovy
190 lines
6.1 KiB
Groovy
buildscript{
|
|
repositories{
|
|
mavenCentral()
|
|
maven { url = 'https://maven.minecraftforge.net' }
|
|
maven { url='https://repo.spongepowered.org/repository/maven-public' }
|
|
}
|
|
dependencies {
|
|
classpath group: 'org.spongepowered', name: 'mixingradle', version: '0.7-SNAPSHOT'
|
|
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
|
|
}
|
|
}
|
|
|
|
plugins {
|
|
id 'eclipse'
|
|
id 'maven-publish'
|
|
id 'net.minecraftforge.gradle' version '5.1.+'
|
|
}
|
|
apply plugin: 'net.minecraftforge.gradle'
|
|
apply plugin: 'org.spongepowered.mixin'
|
|
|
|
version = mod_version
|
|
group = 'vip.fubuki.playersync' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
|
archivesBaseName = 'playersync'
|
|
|
|
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
|
|
|
|
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.16.5'
|
|
|
|
//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/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.16.5-36.2.0'
|
|
|
|
jarJar("curse.maven:MySQL-561280:3685108") {
|
|
jarJar.ranged(it, '[3685108,)')
|
|
}
|
|
|
|
implementation fg.deobf("curse.maven:architectury-api-419699:4521290")
|
|
implementation fg.deobf("curse.maven:astral-sorcery-241721:3813365")
|
|
implementation fg.deobf("curse.maven:ftb-library-forge-404465:3553840")
|
|
implementation fg.deobf("curse.maven:ftb-quests-forge-289412:4297999")
|
|
implementation fg.deobf("curse.maven:MySQL-561280:3685108")
|
|
}
|
|
|
|
mixin {
|
|
add sourceSets.main, "playersync.refmap.json"
|
|
config 'playersync.mixin.json'
|
|
}
|
|
|
|
|
|
// 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"),
|
|
"MixinConfigs" : "playersync.mixin.json"
|
|
])
|
|
}
|
|
}
|
|
|
|
// 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
|
|
}
|