@@ -417,9 +417,10 @@ pub async fn retrieve_data(
417417 }
418418 }
419419
420+ let is_stable = !minecraft_version. contains ( "-snapshot-" ) ;
420421 versions. lock ( ) . await . push ( daedalus:: modded:: Version {
421422 id : minecraft_version,
422- stable : true ,
423+ stable : is_stable ,
423424 loaders : loaders_versions
424425 } ) ;
425426
@@ -569,26 +570,39 @@ pub async fn fetch_maven_metadata(
569570 }
570571
571572 for value in neo_values. versioning . versions . version {
572- let is_snapshot = value. contains ( 'w' ) ||
573- value. contains ( "-pre" ) ||
574- value. contains ( "-rc" ) ;
573+ // Skip weekly snapshots, pre-releases, and release candidates for old MC versions
574+ let is_old_snapshot = value. contains ( 'w' ) ||
575+ value. contains ( "-pre" ) ||
576+ value. contains ( "-rc" ) ;
575577
576- if is_snapshot {
577- info ! ( "Skipping snapshot version: {}" , value) ;
578+ if is_old_snapshot {
579+ info ! ( "Skipping old snapshot version: {}" , value) ;
578580 continue ;
579581 }
580582
581583 let original = value. clone ( ) ;
582-
583584 let mut parts = value. split ( '.' ) ;
584585
585- if let Some ( minor) = parts. next ( ) {
586- if let Some ( patch) = parts. next ( ) {
587- let mut game_version = format ! ( "1.{}" , minor) ;
588-
589- if patch != "0" {
590- game_version. push_str ( & format ! ( ".{}" , patch) ) ;
591- }
586+ if let Some ( major) = parts. next ( ) {
587+ if let Some ( minor) = parts. next ( ) {
588+ // Check for +snapshot-X suffix (new MC version format starting with 26.x)
589+ // NeoForge version: 26.1.0.0-alpha.1+snapshot-1 -> MC version: 26.1-snapshot-1
590+ let game_version = if let Some ( snapshot_suffix) = original. split ( "+snapshot-" ) . nth ( 1 ) {
591+ // Extract snapshot number (e.g., "1" from "1" or from "1+other")
592+ let snapshot_num = snapshot_suffix
593+ . split ( |c : char | !c. is_ascii_digit ( ) )
594+ . next ( )
595+ . unwrap_or ( "1" ) ;
596+ // New format: 26.1-snapshot-1 (no 1. prefix)
597+ format ! ( "{}.{}-snapshot-{}" , major, minor, snapshot_num)
598+ } else {
599+ // Standard format: 1.21.1
600+ if minor == "0" {
601+ format ! ( "1.{}" , major)
602+ } else {
603+ format ! ( "1.{}.{}" , major, minor)
604+ }
605+ } ;
592606
593607 map. entry ( game_version. clone ( ) )
594608 . or_default ( )
0 commit comments