Skip to content

Commit

Permalink
Fix NeoForge versions not matching major mc release correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
RedNesto committed Aug 9, 2024
1 parent abee07f commit 0fcf7a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
- [#2282](https://github.com/minecraft-dev/MinecraftDev/issues/2282) Mixin support confusion with `$` and `.` separators in class names
- Recent NeoModDev version import errors
- Recommended Artifact ID value was not sanitized properly
- NeoForge versions in the Architectury were not being matched correctly for the first version of a major Minecraft release

## [1.8.0]

Expand Down
6 changes: 5 additions & 1 deletion src/main/kotlin/platform/neoforge/version/NeoForgeVersion.kt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ class NeoForgeVersion private constructor(val versions: List<String>) {
fun getNeoForgeVersions(mcVersion: SemanticVersion): List<SemanticVersion> {
val versionText = mcVersion.toString()
// Drop the 1. part of the mc version
val shortMcVersion = versionText.substringAfter('.')
var shortMcVersion = versionText.substringAfter('.')
if (!shortMcVersion.contains('.')) {
// Ensure we have the .0 part
shortMcVersion = "$shortMcVersion.0"
}
val toList = versions.asSequence()
.filter { it.substringBeforeLast('.') == shortMcVersion }
.mapNotNull(SemanticVersion::tryParse)
Expand Down

0 comments on commit 0fcf7a7

Please sign in to comment.