125 lines
3.8 KiB
Groovy
125 lines
3.8 KiB
Groovy
buildscript {
|
|
repositories {
|
|
// These repositories are only for Gradle plugins, put any other repositories in the repository block further below
|
|
maven { url = 'https://maven.minecraftforge.net' }
|
|
maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
|
|
mavenCentral()
|
|
}
|
|
dependencies {
|
|
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
|
|
classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT'
|
|
}
|
|
}
|
|
|
|
apply plugin: 'net.minecraftforge.gradle'
|
|
apply plugin: 'org.spongepowered.mixin'
|
|
|
|
def archiveVersion = "${project.mcVersion}-${project.buildVersion}" as Object
|
|
|
|
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
|
|
|
|
minecraft {
|
|
mappings channel: 'official', version: mcVersion
|
|
|
|
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
|
|
|
|
runs {
|
|
client {
|
|
workingDirectory project.file('run')
|
|
|
|
property 'forge.logging.markers', 'REGISTRIES'
|
|
property 'forge.logging.console.level', 'debug'
|
|
|
|
arg "-mixin.config=${modID}.mixins.json"
|
|
property 'mixin.env.remapRefMap', 'true'
|
|
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
|
|
|
|
mods {
|
|
loginprotection {
|
|
source sourceSets.main
|
|
}
|
|
}
|
|
}
|
|
|
|
server {
|
|
workingDirectory project.file('run')
|
|
|
|
property 'forge.logging.markers', 'REGISTRIES'
|
|
property 'forge.logging.console.level', 'debug'
|
|
|
|
arg "-mixin.config=${modID}.mixins.json"
|
|
property 'mixin.env.remapRefMap', 'true'
|
|
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
|
|
|
|
mods {
|
|
loginprotection {
|
|
source sourceSets.main
|
|
}
|
|
}
|
|
}
|
|
|
|
data {
|
|
workingDirectory project.file('run')
|
|
|
|
property 'forge.logging.markers', 'REGISTRIES'
|
|
property 'forge.logging.console.level', 'debug'
|
|
|
|
arg "-mixin.config=${modID}.mixins.json"
|
|
property 'mixin.env.remapRefMap', 'true'
|
|
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
|
|
|
|
args '--mod', 'loginprotection', '--all',
|
|
'--existing', file('src/main/resources').toString(),
|
|
'--existing', file('src/generated/resources').toString(),
|
|
'--output', file('src/generated/resources/')
|
|
|
|
mods {
|
|
loginprotection {
|
|
source sourceSets.main
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
mixin {
|
|
add sourceSets.main, "${modID}.refmap.json"
|
|
config "${modID}.mixins.json"
|
|
}
|
|
|
|
sourceSets.main.resources {
|
|
srcDir 'src/generated/resources'
|
|
}
|
|
|
|
repositories {
|
|
maven {
|
|
name = "Progwml6 maven"
|
|
url = "https://dvs1.progwml6.com/files/maven/"
|
|
}
|
|
maven {
|
|
name = "ModMaven"
|
|
url = "https://modmaven.dev"
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
minecraft "net.minecraftforge:forge:${project.mcVersion}-${project.forgeVersion}"
|
|
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
|
|
}
|
|
|
|
jar {
|
|
archiveFileName = "${project.archivesBaseName}-${archiveVersion}.jar"
|
|
manifest {
|
|
attributes([
|
|
"Specification-Title" : project.name,
|
|
"Specification-Vendor" : project.author,
|
|
"Specification-Version" : "1",
|
|
"Implementation-Title" : project.name,
|
|
"Implementation-Vendor" : project.author,
|
|
"Implementation-Version" : archiveVersion,
|
|
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
|
|
])
|
|
}
|
|
}
|
|
|
|
jar.finalizedBy('reobfJar') |