Skip to content

Commit

Permalink
loader: error on unsupported versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Sychic committed Jun 11, 2024
1 parent ee69140 commit 5163d93
Showing 1 changed file with 27 additions and 25 deletions.
52 changes: 27 additions & 25 deletions src/main/kotlin/gg/essential/essential-loader.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,32 +32,34 @@ when {
}
}

//FIXME: Fix loader not working on ml
platform.isModLauncher -> {
dependencies {
val relocatedPackage = findProperty("essential.loader.package")?.toString() ?: throw GradleException("""
A package for the Essential loader to be relocated to has not been set.
You need to set `essential.loader.package` in the project's `gradle.properties` file to a package where Essential's loader will be relocated to.
For example: `essential.loader.package = org.example.coolmod.relocated.essential`
""".trimIndent())
val relocationAttribute =
registerRelocationAttribute("essential-loader-relocated") {
relocate("gg.essential.loader.stage0", "$relocatedPackage.stage0")
// preserve stage1 path
rename("gg/essential/loader/stage0/stage1.jar", "gg/essential/loader/stage0/stage1.jar")
}
essentialLoader.attributes {
attribute(relocationAttribute, true)
}
if (platform.mcVersion < 11700) {
"forgeRuntimeLibrary"(essentialLoader("gg.essential:loader-modlauncher8:1.2.2")!!)
} else {
"forgeRuntimeLibrary"(essentialLoader("gg.essential:loader-modlauncher9:1.2.2")!!)
}
}
tasks.named<Jar>("jar") {
dependsOn(essentialLoader)
from({ zipTree(essentialLoader.singleFile) })
}
error("Modlauncher is currently not supported")
// dependencies {
// val relocatedPackage = findProperty("essential.loader.package")?.toString() ?: throw GradleException("""
// A package for the Essential loader to be relocated to has not been set.
// You need to set `essential.loader.package` in the project's `gradle.properties` file to a package where Essential's loader will be relocated to.
// For example: `essential.loader.package = org.example.coolmod.relocated.essential`
// """.trimIndent())
// val relocationAttribute =
// registerRelocationAttribute("essential-loader-relocated") {
// relocate("gg.essential.loader.stage0", "$relocatedPackage.stage0")
// // preserve stage1 path
// rename("gg/essential/loader/stage0/stage1.jar", "gg/essential/loader/stage0/stage1.jar")
// }
// essentialLoader.attributes {
// attribute(relocationAttribute, true)
// }
// if (platform.mcVersion < 11700) {
// "forgeRuntimeLibrary"(essentialLoader("gg.essential:loader-modlauncher8:1.2.2")!!)
// } else {
// "forgeRuntimeLibrary"(essentialLoader("gg.essential:loader-modlauncher9:1.2.2")!!)
// }
// }
// tasks.named<Jar>("jar") {
// dependsOn(essentialLoader)
// from({ zipTree(essentialLoader.singleFile) })
// }
}

else -> error("No loader available for this platform")
Expand Down

0 comments on commit 5163d93

Please sign in to comment.