1.21.1 Update
This commit is contained in:
206
build.gradle
206
build.gradle
@@ -1,135 +1,191 @@
|
||||
plugins {
|
||||
id 'eclipse'
|
||||
id 'idea'
|
||||
id 'net.minecraftforge.gradle' version '[6.0.16,6.2)'
|
||||
id 'maven-publish'
|
||||
id "idea"
|
||||
id "net.neoforged.moddev" version "2.0.74"
|
||||
id "dev.ithundxr.silk" version "0.11.15"
|
||||
id "me.modmuss50.mod-publish-plugin" version "0.8.3"
|
||||
id "maven-publish"
|
||||
}
|
||||
|
||||
apply from: "./gradle/java.gradle"
|
||||
apply from: "gradle/property_loader.gradle"
|
||||
|
||||
group = "com.oierbravo.${mod_id}"
|
||||
group = "com.${mod_author}.${mod_id}"
|
||||
version = "${minecraft_version}-${mod_version}"
|
||||
archivesBaseName = mod_id
|
||||
|
||||
|
||||
java {
|
||||
toolchain.languageVersion = JavaLanguageVersion.of(17)
|
||||
idea {
|
||||
module {
|
||||
downloadJavadoc = true
|
||||
downloadSources = true
|
||||
}
|
||||
}
|
||||
|
||||
minecraft {
|
||||
mappings channel: mapping_channel, version: mapping_version
|
||||
neoForge {
|
||||
version = project.neo_version
|
||||
|
||||
copyIdeResources = true
|
||||
accessTransformers = project.files('src/main/resources/META-INF/accesstransformer.cfg')
|
||||
|
||||
parchment {
|
||||
minecraftVersion = project.parchment_minecraft_version
|
||||
mappingsVersion = project.parchment_version
|
||||
}
|
||||
mods {
|
||||
"$mod_id" {
|
||||
sourceSet sourceSets.main
|
||||
}
|
||||
}
|
||||
runs {
|
||||
// applies to all the run configs below
|
||||
configureEach {
|
||||
workingDirectory project.file('run')
|
||||
systemProperty 'forge.logging.markers', ''
|
||||
systemProperty 'forge.logging.console.level', 'info'
|
||||
jvmArguments = ["-XX:+IgnoreUnrecognizedVMOptions", "-XX:+AllowEnhancedClassRedefinition"]
|
||||
//jvmArgs("-XX:-OmitStackTraceInFastThrow") // uncomment when you get exceptions with null messages etc
|
||||
//jvmArgs '-XX:+UnlockCommercialFeatures' // uncomment for profiling
|
||||
|
||||
// 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'
|
||||
systemProperty 'mixin.debug.export', 'true'
|
||||
systemProperty 'mixin.debug.verbose', 'true'
|
||||
programArgument '-mixin.config=create.mixins.json'
|
||||
//programArgument '-mixin.config=ponder.mixins.json'
|
||||
//systemProperty("mixin.env.remapRefMap", "true")
|
||||
//systemProperty("mixin.env.refMapRemappingFile", "${projectDir}/build/createSrgToMcp/output.srg")
|
||||
|
||||
|
||||
// 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'
|
||||
|
||||
mods {
|
||||
"${mod_id}" {
|
||||
source sourceSets.main
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
client {
|
||||
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
|
||||
property 'forge.enabledGameTestNamespaces', mod_id
|
||||
client()
|
||||
gameDirectory = project.file('run')
|
||||
}
|
||||
|
||||
server {
|
||||
property 'forge.enabledGameTestNamespaces', mod_id
|
||||
args '--nogui'
|
||||
}
|
||||
server()
|
||||
|
||||
// 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 {
|
||||
property 'forge.enabledGameTestNamespaces', mod_id
|
||||
gameDirectory = project.file('run/server')
|
||||
}
|
||||
|
||||
data {
|
||||
// example of overriding the workingDirectory set in configureEach above
|
||||
workingDirectory project.file('run-data')
|
||||
data()
|
||||
|
||||
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
|
||||
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
|
||||
gameDirectory = project.file('run')
|
||||
systemProperty 'forge.logging.markers', 'REGISTRIES,REGISTRYDUMP'
|
||||
systemProperty 'forge.logging.console.level', 'debug'
|
||||
programArguments.addAll("--mod", mod_id as String, "--all", "--output", file("src/generated/resources/").getAbsolutePath(), "--existing", file("src/main/resources").getAbsolutePath())
|
||||
}
|
||||
|
||||
gameTestServer {
|
||||
type = "gameTestServer"
|
||||
|
||||
gameDirectory = project.file('run/gametest')
|
||||
// setForceExit false <- FIXME 1.20
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Include resources generated by data generators.
|
||||
sourceSets.main.resources { srcDir 'src/generated/resources' }
|
||||
sourceSets.main {
|
||||
resources {
|
||||
srcDir 'src/generated/resources'
|
||||
exclude '.cache/'
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven { url = "https://maven.createmod.net" } // Create, Ponder, Flywheel
|
||||
maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" } // ForgeConfigAPIPort
|
||||
maven { url = "https://mvn.devos.one/snapshots" } // Registrate
|
||||
maven { url = "https://maven.blamejared.com" } // JEI, Vazkii's Mods
|
||||
|
||||
maven {
|
||||
// location of the maven for Registrate and Flywheel
|
||||
name = 'tterrag maven'
|
||||
url = 'https://maven.tterrag.com'
|
||||
// location of the maven for Curios API
|
||||
url = "https://maven.theillusivec4.top/"
|
||||
}
|
||||
maven {
|
||||
// location of maven for CC: Tweaked
|
||||
name = "squiddev"
|
||||
url = "https://squiddev.cc/maven/"
|
||||
}
|
||||
|
||||
maven {
|
||||
url = 'https://www.cursemaven.com'
|
||||
content {
|
||||
includeGroup "curse.maven"
|
||||
}
|
||||
}
|
||||
maven {
|
||||
name = "Modrinth"
|
||||
url = "https://api.modrinth.com/maven"
|
||||
content {
|
||||
includeGroup "maven.modrinth"
|
||||
}
|
||||
}
|
||||
maven {
|
||||
url "https://jitpack.io"
|
||||
content {
|
||||
includeGroup "com.github.llamalad7.mixinextras"
|
||||
}
|
||||
}
|
||||
|
||||
maven {
|
||||
url "https://maven.saps.dev/minecraft"
|
||||
content {
|
||||
includeGroup "dev.latvian.mods"
|
||||
includeGroup "dev.ftb.mods"
|
||||
}
|
||||
}
|
||||
maven {
|
||||
url "https://maven.architectury.dev/"
|
||||
content {
|
||||
includeGroup "dev.architectury"
|
||||
}
|
||||
}
|
||||
mavenLocal()
|
||||
flatDir {
|
||||
dirs 'libs'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
|
||||
implementation 'org.jetbrains:annotations:22.0.0'
|
||||
|
||||
implementation("com.simibubi.create:create-${minecraft_version}:${create_version}:slim") { transitive = false }
|
||||
implementation("net.createmod.ponder:Ponder-NeoForge-${minecraft_version}:${ponder_version}")
|
||||
compileOnly("dev.engine-room.flywheel:flywheel-neoforge-api-${minecraft_version}:${flywheel_version}")
|
||||
runtimeOnly("dev.engine-room.flywheel:flywheel-neoforge-${minecraft_version}:${flywheel_version}")
|
||||
implementation("com.tterrag.registrate:Registrate:${registrate_version}")
|
||||
|
||||
compileOnly("top.theillusivec4.curios:curios-neoforge:${curios_version}+${curios_minecraft_version}:api")
|
||||
runtimeOnly("top.theillusivec4.curios:curios-neoforge:${curios_version}+${curios_minecraft_version}")
|
||||
|
||||
implementation("curse.maven:jade-324717:${jade_id}")
|
||||
|
||||
//runtimeOnly("dev.architectury:architectury-neoforge:13.0.8")
|
||||
//implementation("dev.ftb.mods:ftb-chunks-neoforge:2101.1.1")
|
||||
//implementation("dev.ftb.mods:ftb-teams-neoforge:2101.1.0")
|
||||
//implementation("dev.ftb.mods:ftb-library-neoforge:2101.1.3")
|
||||
|
||||
implementation fg.deobf("curse.maven:jade-324717:${jade_id}")
|
||||
|
||||
implementation fg.deobf("com.simibubi.create:create-${create_minecraft_version}:${create_version}:slim") { transitive = false }
|
||||
implementation fg.deobf("com.jozufozu.flywheel:flywheel-forge-${flywheel_minecraft_version}:${flywheel_version}")
|
||||
implementation fg.deobf("com.tterrag.registrate:Registrate:${registrate_version}")
|
||||
}
|
||||
|
||||
tasks.named('processResources', ProcessResources).configure {
|
||||
var replaceProperties = [minecraft_version : minecraft_version, minecraft_version_range: minecraft_version_range,
|
||||
forge_version : forge_version, forge_version_range: forge_version_range,
|
||||
loader_version_range: loader_version_range,
|
||||
mod_id : mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version,
|
||||
mod_authors : mod_authors, mod_description: mod_description,]
|
||||
processResources {
|
||||
def buildProps = project.properties.clone()
|
||||
|
||||
inputs.properties replaceProperties
|
||||
// Replaces FML's magic file.jarVersion string with the correct version at build time.
|
||||
buildProps.put('file', [jarVersion: project.version])
|
||||
|
||||
filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) {
|
||||
expand replaceProperties + [project: project]
|
||||
filesMatching(['META-INF/neoforge.mods.toml', 'pack.mcmeta']) {
|
||||
expand buildProps
|
||||
}
|
||||
}
|
||||
compileJava {
|
||||
options.compilerArgs = ['-Xdiags:verbose']
|
||||
}
|
||||
|
||||
tasks.named('jar', Jar).configure {
|
||||
manifest {
|
||||
attributes(["Specification-Title" : mod_id,
|
||||
"Specification-Vendor" : mod_authors,
|
||||
"Specification-Version" : "1", // We are version 1 of ourselves
|
||||
"Implementation-Title" : project.name,
|
||||
"Implementation-Version" : project.jar.archiveVersion,
|
||||
"Implementation-Vendor" : mod_authors,
|
||||
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")])
|
||||
jar {
|
||||
from('LICENSE') {
|
||||
rename { "${it}_${archivesBaseName}" }
|
||||
}
|
||||
|
||||
finalizedBy 'reobfJar'
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
|
||||
}
|
||||
publishing {
|
||||
// other settings of publication
|
||||
publications {
|
||||
|
||||
Reference in New Issue
Block a user