Update to neoforge
This commit is contained in:
parent
fa67381990
commit
b954fead1c
4 changed files with 77 additions and 58 deletions
48
build.gradle
48
build.gradle
|
@ -1,9 +1,10 @@
|
|||
plugins {
|
||||
id 'eclipse'
|
||||
id 'java-library'
|
||||
id 'idea'
|
||||
id 'maven-publish'
|
||||
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
|
||||
id 'org.parchmentmc.librarian.forgegradle' version '1.+'
|
||||
id 'net.neoforged.gradle' version '[6.0.18,6.2)'
|
||||
id 'org.spongepowered.mixin' version '0.7.+'
|
||||
}
|
||||
|
||||
version = mod_version
|
||||
|
@ -13,6 +14,11 @@ base {
|
|||
archivesName = mod_id
|
||||
}
|
||||
|
||||
java {
|
||||
withJavadocJar()
|
||||
withSourcesJar()
|
||||
}
|
||||
|
||||
// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
|
||||
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
|
||||
|
||||
|
@ -61,7 +67,7 @@ minecraft {
|
|||
runs {
|
||||
// applies to all the run configs below
|
||||
configureEach {
|
||||
workingDirectory project.file('run')
|
||||
workingDirectory project.file("run/${it.name}")
|
||||
|
||||
// Recommended logging data for a userdev environment
|
||||
// The markers can be added/remove as needed separated by commas.
|
||||
|
@ -89,7 +95,7 @@ minecraft {
|
|||
|
||||
server {
|
||||
property 'forge.enabledGameTestNamespaces', mod_id
|
||||
//args '--nogui'
|
||||
args '--nogui'
|
||||
}
|
||||
|
||||
// This run config launches GameTestServer and runs all registered gametests, then exits.
|
||||
|
@ -100,8 +106,8 @@ minecraft {
|
|||
}
|
||||
|
||||
data {
|
||||
// example of overriding the workingDirectory set in configureEach above
|
||||
workingDirectory project.file('run-data')
|
||||
// example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it
|
||||
// workingDirectory project.file('run-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/')
|
||||
|
@ -150,7 +156,7 @@ dependencies {
|
|||
// The "userdev" classifier will be requested and setup by ForgeGradle.
|
||||
// If the group id is "net.minecraft" and the artifact id is one of ["client", "server", "joined"],
|
||||
// then special handling is done to allow a setup of a vanilla dependency without the use of an external repository.
|
||||
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
|
||||
minecraft "net.neoforged:forge:${minecraft_version}-${neo_version}"
|
||||
|
||||
implementation fg.deobf("dev.zontreck:LibZontreckMod:${libzontreck}")
|
||||
// Example mod dependency with JEI - using fg.deobf() ensures the dependency is remapped to your development mappings
|
||||
|
@ -173,13 +179,13 @@ dependencies {
|
|||
// A missing property will result in an error. Properties are expanded using ${} Groovy notation.
|
||||
// When "copyIdeResources" is enabled, this will also run before the game launches in IDE environments.
|
||||
// See https://docs.gradle.org/current/dsl/org.gradle.language.jvm.tasks.ProcessResources.html
|
||||
tasks.named('processResources', ProcessResources).configure {
|
||||
tasks.withType(ProcessResources).configureEach {
|
||||
var replaceProperties = [
|
||||
minecraft_version: minecraft_version, minecraft_version_range: minecraft_version_range,
|
||||
forge_version: forge_version, forge_version_range: forge_version_range,
|
||||
minecraft_version : minecraft_version, minecraft_version_range: minecraft_version_range,
|
||||
neo_version : neo_version, neo_version_range: neo_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,
|
||||
mod_id : mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version,
|
||||
mod_authors : mod_authors, mod_description: mod_description, pack_format_number: pack_format_number,
|
||||
]
|
||||
inputs.properties replaceProperties
|
||||
|
||||
|
@ -188,6 +194,7 @@ tasks.named('processResources', ProcessResources).configure {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// Example for how to get properties into the manifest for reading at runtime.
|
||||
tasks.named('jar', Jar).configure {
|
||||
manifest {
|
||||
|
@ -206,25 +213,36 @@ tasks.named('jar', Jar).configure {
|
|||
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:
|
||||
// tasks.named('publish').configure {
|
||||
// dependsOn 'reobfJar'
|
||||
// }
|
||||
|
||||
// Example configuration to allow publishing using the maven-publish plugin
|
||||
def MAVEN_PASSWORD_PROPERTY = "AriasCreationsMavenPassword"
|
||||
publishing {
|
||||
publications {
|
||||
register('mavenJava', MavenPublication) {
|
||||
mavenJava(MavenPublication) {
|
||||
artifact jar
|
||||
artifact sourcesJar
|
||||
artifact javadocJar
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
maven {
|
||||
url "file://${project.projectDir}/mcmodsrepo"
|
||||
url = "https://maven.zontreck.com/repository/zontreck"
|
||||
name = "ariascreations"
|
||||
if (project.findProperty(MAVEN_PASSWORD_PROPERTY) != null) {
|
||||
credentials {
|
||||
username = "admin"
|
||||
password = project.findProperty(MAVEN_PASSWORD_PROPERTY)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue