Skip to content

Commit

Permalink
1.20.5 neoforge
Browse files Browse the repository at this point in the history
  • Loading branch information
isXander committed Apr 29, 2024
1 parent e0b3f5b commit a68da62
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 33 deletions.
35 changes: 3 additions & 32 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
`java-library`
kotlin("jvm") version "1.9.22"
kotlin("jvm") version "1.9.23"

id("dev.architectury.loom") version "1.6.+"

id("me.modmuss50.mod-publish-plugin") version "0.5.+"
`maven-publish`
id("org.ajoberstar.grgit") version "5.0.+"

id("io.github.p03w.machete") version "2.+"
}

val loader = loom.platform.get().name.lowercase()
Expand Down Expand Up @@ -181,7 +179,6 @@ dependencies {

java {
withSourcesJar()
//withJavadocJar()
}

tasks {
Expand Down Expand Up @@ -210,11 +207,9 @@ tasks {

if (isFabric) {
filesMatching("fabric.mod.json") { expand(props) }
exclude("META-INF/mods.toml")
}
if (isForgeLike) {
filesMatching("META-INF/mods.toml") { expand(props) }
exclude("fabric.mod.json")
filesMatching(listOf("META-INF/mods.toml", "META-INF/neoforge.mods.toml")) { expand(props) }
}
}

Expand All @@ -226,10 +221,6 @@ tasks {
}
}

machete {
json.enabled.set(false)
}

java {
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_17
Expand Down Expand Up @@ -273,10 +264,6 @@ publishMods {

requires { slug.set("fabric-api") }
}

tasks.getByName("publishModrinth") {
dependsOn("optimizeOutputsOfRemapJar")
}
}

val curseforgeId: String by project
Expand All @@ -288,10 +275,6 @@ publishMods {

requires { slug.set("fabric-api") }
}

tasks.getByName("publishCurseforge") {
dependsOn("optimizeOutputsOfRemapJar")
}
}

val githubProject: String by project
Expand All @@ -301,10 +284,6 @@ publishMods {
accessToken.set(findProperty("github.token")?.toString())
commitish.set(grgit.branch.current().name)
}

tasks.getByName("publishGithub") {
dependsOn("optimizeOutputsOfRemapJar")
}
}
}

Expand Down Expand Up @@ -337,22 +316,14 @@ publishing {
this.password = password
}
}
tasks.getByName("publishModPublicationToXanderReleasesRepository") {
dependsOn("optimizeOutputsOfRemapJar")
}
} else {
println("Xander Maven credentials not satisfied.")
}
}
}

tasks.getByName("generateMetadataFileForModPublication") {
dependsOn("optimizeOutputsOfRemapJar")
}

fun <T> optionalProp(property: String, block: (String) -> T?) {
fun <T> optionalProp(property: String, block: (String) -> T?): T? =
findProperty(property)?.toString()?.takeUnless { it.isBlank() }?.let(block)
}

fun isPropDefined(property: String): Boolean {
return property(property)?.toString()?.isNotBlank() ?: false
Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This build supports the following versions:
- Fabric 1.20.5
- Forge 1.20.1
- NeoForge 1.20.4
- NeoForge 1.20.5

## Bug Fixes

Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ extensions.configure<StonecutterSettings> {

mc("1.20.4", loaders = listOf("fabric", "neoforge"))
mc("1.20.1", loaders = listOf("fabric", "forge"))
mc("1.20.5", loaders = listOf("fabric"))
mc("1.20.5", loaders = listOf("fabric", "neoforge"))
}
create(rootProject)
}
Expand Down
31 changes: 31 additions & 0 deletions src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
modLoader = "javafml"
loaderVersion = "${loaderVersion}"
#issueTrackerURL = ""
license = "LGPL-3.0-or-later"

[[mods]]
modId = "${id}"
version = "${version}"
displayName = "${name}"
authors = "isXander"
description = '''
${description}
'''
logoFile = "yacl-128x.png"

[[mixins]]
config = "yacl.mixins.json"

[["dependencies.${id}"]]
modId = "${forgeId}"
mandatory = true
versionRange = "${forgeConstraint}"
ordering = "NONE"
side = "BOTH"

[["dependencies.${id}"]]
modId = "minecraft"
mandatory = true
versionRange = "${mc}"
ordering = "NONE"
side = "BOTH"
11 changes: 11 additions & 0 deletions versions/1.20.5-neoforge/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
loom.platform=neoforge

java.version=21

deps.quiltMappings=
deps.neoforge=20.5.20-beta

modstoml.mcDep=[1.20.5,1.20.6]
modstoml.loaderVersion=[1,)
modstoml.forgeId=neoforge
modstoml.forgeConstraint=[20,)

0 comments on commit a68da62

Please sign in to comment.