Update to 1.20
This commit is contained in:
96
build.gradle
96
build.gradle
@@ -1,12 +1,15 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'eclipse'
|
||||
id 'net.minecraftforge.gradle' version '5.1.+'
|
||||
id 'net.minecraftforge.gradle' version '6.0.+'
|
||||
id 'me.hypherionmc.cursegradle' version '2.+'
|
||||
}
|
||||
|
||||
archivesBaseName = "${mod_name}-${minecraft_version}"
|
||||
version = mod_version
|
||||
|
||||
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
|
||||
javadoc.options.addStringOption('Xdoclint:none', '-quiet')
|
||||
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + ' (' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
|
||||
|
||||
minecraft {
|
||||
@@ -16,25 +19,10 @@ minecraft {
|
||||
runs {
|
||||
client {
|
||||
workingDirectory project.file('run')
|
||||
taskName project.name + 'Client'
|
||||
|
||||
// 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', "${mod_id}"
|
||||
taskName "${project.name}Client"
|
||||
|
||||
mods {
|
||||
modSource {
|
||||
"${mod_id}" {
|
||||
source sourceSets.main
|
||||
}
|
||||
}
|
||||
@@ -42,32 +30,21 @@ minecraft {
|
||||
|
||||
server {
|
||||
workingDirectory project.file('run')
|
||||
taskName project.name + 'Server'
|
||||
|
||||
// property 'forge.logging.markers', 'REGISTRIES'
|
||||
// property 'forge.logging.console.level', 'debug'
|
||||
// property 'forge.enabledGameTestNamespaces', 'examplemod'
|
||||
taskName "${project.name}Server"
|
||||
|
||||
mods {
|
||||
modSource {
|
||||
"${mod_id}" {
|
||||
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')
|
||||
taskName project.name + 'GameTest'
|
||||
|
||||
// property 'forge.logging.markers', 'REGISTRIES'
|
||||
// property 'forge.logging.console.level', 'debug'
|
||||
// property 'forge.enabledGameTestNamespaces', 'examplemod'
|
||||
taskName "${project.name}GameTest"
|
||||
|
||||
mods {
|
||||
modSource {
|
||||
"${mod_id}" {
|
||||
source sourceSets.main
|
||||
}
|
||||
}
|
||||
@@ -75,15 +52,12 @@ minecraft {
|
||||
|
||||
data {
|
||||
workingDirectory project.file('run')
|
||||
taskName project.name + 'Data'
|
||||
|
||||
// property 'forge.logging.markers', 'REGISTRIES'
|
||||
// property 'forge.logging.console.level', 'debug'
|
||||
taskName "${project.name}Data"
|
||||
|
||||
args '--mod', "${mod_id}", '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
|
||||
|
||||
mods {
|
||||
modSource {
|
||||
"${mod_id}" {
|
||||
source sourceSets.main
|
||||
}
|
||||
}
|
||||
@@ -93,33 +67,8 @@ minecraft {
|
||||
|
||||
sourceSets.main.resources.srcDir 'src/generated/resources'
|
||||
|
||||
repositories {
|
||||
// Put repositories for dependencies here
|
||||
// ForgeGradle automatically adds the Forge maven and Maven Central for you
|
||||
|
||||
// If you have mod jar dependencies in ./libs, you can declare them as a repository like so:
|
||||
// flatDir {
|
||||
// dir 'libs'
|
||||
// }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
|
||||
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
|
||||
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
|
||||
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
|
||||
|
||||
// Real mod deobf dependency examples - these get remapped to your current mappings
|
||||
// compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency
|
||||
// runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") // Adds the full JEI mod as a runtime dependency
|
||||
// implementation fg.deobf("com.tterrag.registrate:Registrate:MC${mc_version}-${registrate_version}") // Adds registrate as a dependency
|
||||
|
||||
// Examples using mod jars from ./libs
|
||||
// implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}")
|
||||
|
||||
// For more info...
|
||||
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
|
||||
// http://www.gradle.org/docs/current/userguide/dependency_management.html
|
||||
}
|
||||
|
||||
jar {
|
||||
@@ -152,3 +101,24 @@ processResources {
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
options.encoding = 'UTF-8'
|
||||
}
|
||||
|
||||
curseforge {
|
||||
apiKey = project.hasProperty("curse_api_key") ? curse_api_key : ''
|
||||
project {
|
||||
id = curse_project_id
|
||||
changelog = file('changelog.txt').canRead() ? file('changelog.txt').text : ''
|
||||
changelogType = 'text'
|
||||
releaseType = 'release'
|
||||
addGameVersion 'Forge'
|
||||
forge_compatible_minecraft_versions.split(",").each {
|
||||
addGameVersion(it)
|
||||
}
|
||||
mainArtifact(jar) {
|
||||
displayName = "${minecraft_version}-${mod_version} Universal"
|
||||
}
|
||||
}
|
||||
options {
|
||||
javaVersionAutoDetect = false
|
||||
forgeGradleIntegration = false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user