Update to neoforge

This commit is contained in:
Zontreck 2024-02-14 05:10:51 -07:00
parent 04e12c1311
commit f7fde62e7a
3 changed files with 27 additions and 24 deletions

View file

@ -2,8 +2,9 @@ plugins {
id 'eclipse' id 'eclipse'
id 'idea' id 'idea'
id 'maven-publish' id 'maven-publish'
id 'net.minecraftforge.gradle' version '[6.0,6.2)' id 'net.neoforged.gradle' version '[6.0.18,6.2)'
id 'org.parchmentmc.librarian.forgegradle' version '1.+' id 'org.spongepowered.mixin' version '0.7.+'
//id 'org.parchmentmc.librarian.forgegradle' version '1.+'
} }
version = mod_version version = mod_version
@ -66,7 +67,7 @@ minecraft {
runs { runs {
// applies to all the run configs below // applies to all the run configs below
configureEach { configureEach {
workingDirectory project.file('run') workingDirectory project.file("run/${it.name}")
// Recommended logging data for a userdev environment // Recommended logging data for a userdev environment
// The markers can be added/remove as needed separated by commas. // The markers can be added/remove as needed separated by commas.
@ -105,13 +106,14 @@ minecraft {
} }
data { data {
// example of overriding the workingDirectory set in configureEach above // example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it
workingDirectory project.file('run-data') // workingDirectory project.file('run-data')
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources. // 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/') args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
} }
} }
} }
// Include resources generated by data generators. // Include resources generated by data generators.
@ -155,7 +157,8 @@ dependencies {
// The "userdev" classifier will be requested and setup by ForgeGradle. // 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"], // 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. // 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}") implementation fg.deobf("dev.zontreck:LibZontreckMod:${libzontreck}")
// Example mod dependency with JEI - using fg.deobf() ensures the dependency is remapped to your development mappings // Example mod dependency with JEI - using fg.deobf() ensures the dependency is remapped to your development mappings
@ -178,13 +181,13 @@ dependencies {
// A missing property will result in an error. Properties are expanded using ${} Groovy notation. // 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. // 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 // 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 = [ var replaceProperties = [
minecraft_version: minecraft_version, minecraft_version_range: minecraft_version_range, minecraft_version : minecraft_version, minecraft_version_range: minecraft_version_range,
forge_version: forge_version, forge_version_range: forge_version_range, neo_version : neo_version, neo_version_range: neo_version_range,
loader_version_range: loader_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_id : mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version,
mod_authors: mod_authors, mod_description: mod_description, mod_authors : mod_authors, mod_description: mod_description, pack_format_number: pack_format_number,
] ]
inputs.properties replaceProperties inputs.properties replaceProperties
@ -193,6 +196,7 @@ tasks.named('processResources', ProcessResources).configure {
} }
} }
// Example for how to get properties into the manifest for reading at runtime. // Example for how to get properties into the manifest for reading at runtime.
tasks.named('jar', Jar).configure { tasks.named('jar', Jar).configure {
manifest { manifest {

View file

@ -3,21 +3,19 @@
org.gradle.jvmargs=-Xmx3G org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false org.gradle.daemon=false
libzontreck=1.10.021324.2257 libzontreck=1.10.021424.0400
## Environment Properties ## Environment Properties
# The Minecraft version must agree with the Forge version to get a valid artifact # The Minecraft version must agree with the Forge version to get a valid artifact
minecraft_version=1.20.1 minecraft_version=1.20.1
# The Minecraft version range can use any release version of Minecraft as bounds.
# Snapshots, pre-releases, and release candidates are not guaranteed to sort properly minecraft_version_range=[1.20,1.21)
# as they do not follow standard versioning conventions. # The Neo version must agree with the Minecraft version to get a valid artifact
minecraft_version_range=[1.20.1,1.21) neo_version=47.1.65
# The Forge version must agree with the Minecraft version to get a valid artifact # The Neo version range can use any version of Neo as bounds or match the loader version range
forge_version=47.2.0 neo_version_range=[47.1,)
# The Forge version range can use any version of Forge as bounds or match the loader version range # The loader version range can only use the major version of Neo/FML as bounds
forge_version_range=[47,)
# The loader version range can only use the major version of Forge/FML as bounds
loader_version_range=[47,) loader_version_range=[47,)
# The mapping channel to use for mappings. # The mapping channel to use for mappings.
# The default set of supported mapping channels are ["official", "snapshot", "snapshot_nodoc", "stable", "stable_nodoc"]. # The default set of supported mapping channels are ["official", "snapshot", "snapshot_nodoc", "stable", "stable_nodoc"].
@ -33,10 +31,11 @@ loader_version_range=[47,)
# #
# Parchment is an unofficial project maintained by ParchmentMC, separate from Minecraft Forge. # Parchment is an unofficial project maintained by ParchmentMC, separate from Minecraft Forge.
# Additional setup is needed to use their mappings, see https://parchmentmc.org/docs/getting-started # Additional setup is needed to use their mappings, see https://parchmentmc.org/docs/getting-started
mapping_channel=parchment mapping_channel=official
# The mapping version to query from the mapping channel. # The mapping version to query from the mapping channel.
# This must match the format required by the mapping channel. # This must match the format required by the mapping channel.
mapping_version=2023.09.03-1.20.1 mapping_version=1.20.1
## Mod Properties ## Mod Properties

View file

@ -3,6 +3,6 @@
"description": { "description": {
"text": "${mod_id} resources" "text": "${mod_id} resources"
}, },
"pack_format": 15 "pack_format": ${pack_format_number}
} }
} }