2021-09-01 01:12:30 +02:00
|
|
|
plugins {
|
|
|
|
id "java"
|
|
|
|
id "idea"
|
|
|
|
id "maven-publish"
|
|
|
|
id "net.minecraftforge.gradle" version "5.1.+"
|
|
|
|
id "org.spongepowered.mixin" version "0.7-SNAPSHOT"
|
|
|
|
id "com.github.johnrengelman.shadow" version "7.0.0"
|
2021-02-16 21:39:05 +01:00
|
|
|
}
|
|
|
|
|
2021-09-01 01:12:30 +02:00
|
|
|
version = "${minecraft_version}-${mod_version}"
|
|
|
|
group = "${mod_base_package}.${mod_id}"
|
|
|
|
archivesBaseName = mod_id
|
2021-02-16 21:39:05 +01:00
|
|
|
|
2021-09-01 01:12:30 +02:00
|
|
|
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
|
|
|
|
compileJava.options.encoding = "UTF-8"
|
2021-02-16 21:39:05 +01:00
|
|
|
|
|
|
|
minecraft {
|
2021-09-01 01:12:30 +02:00
|
|
|
mappings channel: mappings_channel, version: mappings_version
|
|
|
|
|
|
|
|
runs {
|
|
|
|
client {
|
|
|
|
workingDirectory project.file("run")
|
|
|
|
|
|
|
|
property 'forge.logging.markers', 'REGISTRIES'
|
|
|
|
property "forge.logging.console.level", "debug"
|
|
|
|
|
|
|
|
// mixin
|
|
|
|
property 'mixin.debug.export', 'true'
|
|
|
|
property "mixin.hotSwap", "true"
|
|
|
|
property "fml.coreMods.load", "de.enzaxd.viaforge.injection.MixinLoader"
|
2021-09-10 17:55:16 +02:00
|
|
|
|
|
|
|
if (project.hasProperty('mc_uuid'))
|
2021-09-01 01:12:30 +02:00
|
|
|
args '--uuid', project.getProperty('mc_uuid')
|
2021-09-10 17:55:16 +02:00
|
|
|
|
|
|
|
if (project.hasProperty('mc_username'))
|
2021-09-01 01:12:30 +02:00
|
|
|
args '--username', project.getProperty('mc_username')
|
2021-09-10 17:55:16 +02:00
|
|
|
|
|
|
|
if (project.hasProperty('mc_accessToken'))
|
2021-09-01 01:12:30 +02:00
|
|
|
args '--accessToken', project.getProperty('mc_accessToken')
|
|
|
|
|
|
|
|
args '-mixin.config=' + 'mixins.' + project.getProperty('mod_id') + '.json'
|
|
|
|
|
|
|
|
mods {
|
|
|
|
"${mod_id}" {
|
|
|
|
source sourceSets.main
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-02-16 21:39:05 +01:00
|
|
|
}
|
|
|
|
|
2021-09-01 01:12:30 +02:00
|
|
|
sourceSets.main.resources { srcDir 'src/generated/resources' }
|
2021-02-16 21:39:05 +01:00
|
|
|
|
|
|
|
repositories {
|
2021-09-01 01:12:30 +02:00
|
|
|
maven { url = "https://repo.spongepowered.org/repository/maven-public" }
|
|
|
|
maven { url = "https://repo.viaversion.com" }
|
2021-02-16 21:39:05 +01:00
|
|
|
}
|
|
|
|
|
2021-09-01 01:12:30 +02:00
|
|
|
configurations {
|
|
|
|
include
|
|
|
|
implementation.extendsFrom(include)
|
2021-02-16 21:39:05 +01:00
|
|
|
}
|
|
|
|
|
2021-09-01 01:12:30 +02:00
|
|
|
dependencies {
|
|
|
|
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
|
|
|
|
|
|
|
|
include "org.spongepowered:mixin:${mixin_version}"
|
2021-09-10 17:55:16 +02:00
|
|
|
include "com.viaversion:viaversion:${viaversion_version}"
|
|
|
|
include "com.viaversion:viabackwards:${viabackwards_version}"
|
2021-09-01 01:12:30 +02:00
|
|
|
include "org.yaml:snakeyaml:1.29"
|
|
|
|
|
|
|
|
annotationProcessor "org.spongepowered:mixin:${mixin_version}:processor"
|
|
|
|
annotationProcessor "org.spongepowered:mixin:${mixin_version}:processor"
|
2021-02-16 21:39:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
mixin {
|
2021-09-01 01:12:30 +02:00
|
|
|
add sourceSets.main, "mixins.${mod_id}.refmap.json"
|
2021-02-16 21:39:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
jar {
|
|
|
|
manifest.attributes(
|
2021-09-01 01:12:30 +02:00
|
|
|
"Specification-Title": "viaforge",
|
|
|
|
"Specification-Vendor": "viaforge",
|
|
|
|
"Specification-Version": "1",
|
|
|
|
"Implementation-Title": project.name,
|
|
|
|
"Implementation-Version": "${archiveVersion}",
|
|
|
|
"Implementation-Vendor" :"viaforge",
|
|
|
|
"Implementation-Timestamp": new Date().format("yyyy-MM-dd"-"HH:mm:ssZ"),
|
|
|
|
"TweakClass": "org.spongepowered.asm.launch.MixinTweaker",
|
|
|
|
"TweakOrder": "0",
|
2022-09-26 14:42:30 +02:00
|
|
|
"FMLCorePluginContainsFMLMod": "true",
|
|
|
|
"FMLCorePlugin": "de.enzaxd.viaforge.injection.MixinLoader",
|
|
|
|
"MixinConfigs": "mixins.${mod_id}.json",
|
|
|
|
"ForceLoadAsMod": "true"
|
2021-02-16 21:39:05 +01:00
|
|
|
)
|
2021-09-01 01:12:30 +02:00
|
|
|
enabled = false
|
2021-02-16 21:39:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
shadowJar {
|
2021-09-01 01:12:30 +02:00
|
|
|
archiveFileName = jar.archiveFileName
|
|
|
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
|
|
|
configurations = [project.configurations.include]
|
|
|
|
exclude "LICENSE.md"
|
|
|
|
exclude "dummyThing"
|
|
|
|
exclude "**/module-info.class"
|
|
|
|
exclude "*.so"
|
|
|
|
exclude "*.dylib"
|
|
|
|
exclude "*.dll"
|
|
|
|
exclude "*.jnilib"
|
|
|
|
exclude "ibxm/**"
|
|
|
|
exclude "com/jcraft/**"
|
|
|
|
exclude "org/lwjgl/**"
|
|
|
|
exclude "net/java/**"
|
|
|
|
|
|
|
|
exclude "META-INF/proguard/**"
|
|
|
|
exclude "META-INF/maven/**"
|
|
|
|
exclude "META-INF/versions/**"
|
|
|
|
exclude "META-INF/com.android.tools/**"
|
|
|
|
|
|
|
|
exclude "fabric.mod.json"
|
|
|
|
exclude "bungee.yml"
|
|
|
|
exclude "plugin.yml"
|
|
|
|
exclude "velocity-plugin.json"
|
|
|
|
exclude "LICENSE.txt"
|
2021-02-16 21:39:05 +01:00
|
|
|
}
|
|
|
|
|
2021-09-01 01:12:30 +02:00
|
|
|
reobf {
|
|
|
|
shadowJar {}
|
2021-02-16 21:39:05 +01:00
|
|
|
}
|
|
|
|
|
2021-09-01 01:12:30 +02:00
|
|
|
jar.dependsOn("shadowJar")
|