Skip to content

Commit 145dd05

Browse files
committed
Add fix for non-standard NeoForge versions
1 parent 64ff665 commit 145dd05

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

installer/src/main/kotlin/gg/essential/installer/modloader/NeoForgeModloader.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ object NeoForgeModloader : Modloader(ModloaderType.NEOFORGE) {
9494

9595
return neoforgeVersionList.fold(mutableMapOf<MCVersion, MutableList<ModloaderVersion>>()) { acc, ver ->
9696
val modloaderVersion = ModloaderVersion.fromVersion(ModloaderType.NEOFORGE, ver)
97+
// NeoForge decided to support the craftmine april fools, which was the first version that (obviously) didn't have the numeric version parseable
98+
if (modloaderVersion.numeric.isBlank()) {
99+
logger.warn("Failed to parse $ver! No numeric version was found...")
100+
return@fold acc
101+
}
97102
val versionRaw = "1." + modloaderVersion.numeric.substring(0..<modloaderVersion.numeric.lastIndexOf('.'))
98103
val mcVersion = MCVersion.fromString(versionRaw) ?: return@fold acc
99104
val list = acc.getOrPut(mcVersion) { mutableListOf() }

0 commit comments

Comments
 (0)