Skip to content

Commit 0fcf7a7

Browse files
committed
Fix NeoForge versions not matching major mc release correctly
1 parent abee07f commit 0fcf7a7

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
- [#2282](https://github.com/minecraft-dev/MinecraftDev/issues/2282) Mixin support confusion with `$` and `.` separators in class names
2929
- Recent NeoModDev version import errors
3030
- Recommended Artifact ID value was not sanitized properly
31+
- NeoForge versions in the Architectury were not being matched correctly for the first version of a major Minecraft release
3132

3233
## [1.8.0]
3334

src/main/kotlin/platform/neoforge/version/NeoForgeVersion.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ class NeoForgeVersion private constructor(val versions: List<String>) {
4848
fun getNeoForgeVersions(mcVersion: SemanticVersion): List<SemanticVersion> {
4949
val versionText = mcVersion.toString()
5050
// Drop the 1. part of the mc version
51-
val shortMcVersion = versionText.substringAfter('.')
51+
var shortMcVersion = versionText.substringAfter('.')
52+
if (!shortMcVersion.contains('.')) {
53+
// Ensure we have the .0 part
54+
shortMcVersion = "$shortMcVersion.0"
55+
}
5256
val toList = versions.asSequence()
5357
.filter { it.substringBeforeLast('.') == shortMcVersion }
5458
.mapNotNull(SemanticVersion::tryParse)

0 commit comments

Comments
 (0)