@@ -76,20 +76,24 @@ const START_SNAPSHOTS: Record<string, Record<PackType, FormatResult>> = {
7676const SPECIAL : Record < PackType , Record < number , string [ ] > > = {
7777 resource : {
7878 4 : [ 'combat1' , 'combat2' , 'combat3' ] ,
79- 5 : [ 'combat4' , 'combat5' ] ,
79+ 5 : [ '1.16.2-pre' , ' combat4', 'combat5' ] ,
8080 6 : [ 'combat6' , 'combat7a' , 'combat7b' , 'combat8a' , 'combat8b' , 'combat8c' ] ,
81+ 7 : [ '1.18-exp' ] ,
82+ 13 : [ '1.19.4-pre' ] ,
8183 17 : [ '1.20.2-pre1' ] ,
8284 31 : [ '1.20.5-pre1' , '1.20.5-pre2' , '1.20.5-pre3' ] ,
83- 32 : [ '1.20.5-pre4' , '1.20.5-rc1' , '1.20.5-rc2' , '1.20.5-rc3 '] ,
84- 34 : [ '1.21-pre1' , '1.21-pre2' , '1.21-pre3 '] , // NOTE: can remove this line if 1.21-release is also 34
85+ 32 : [ '1.20.5-pre4' , '1.20.5-rc ' ] ,
86+ 34 : [ '1.21-pre ' ] , // NOTE: can remove this line if 1.21-release is also 34
8587 } ,
8688 data : {
8789 4 : [ 'combat1' , 'combat2' , 'combat3' ] ,
88- 5 : [ 'combat4' , 'combat5' ] ,
90+ 5 : [ '1.16.2-pre' , ' combat4', 'combat5' ] ,
8991 6 : [ 'combat6' , 'combat7a' , 'combat7b' , 'combat8a' , 'combat8b' , 'combat8c' ] ,
92+ 7 : [ '1.18-exp' ] ,
93+ 12 : [ '1.19.4-pre' ] ,
9094 39 : [ '1.20.5-pre1' ] ,
9195 40 : [ '1.20.5-pre2' ] ,
92- 41 : [ '1.20.5-pre3' , '1.20.5-pre4' , '1.20.5-rc1' , '1.20.5-rc2' , '1.20.5-rc3 '] ,
96+ 41 : [ '1.20.5-pre3' , '1.20.5-pre4' , '1.20.5-rc ' ] ,
9397 46 : [ '1.21-pre1' ] ,
9498 47 : [ '1.21-pre2' ] ,
9599 48 : [ '1.21-pre3' ] ,
@@ -113,13 +117,13 @@ function getPackFormat(version: string, type: PackType = 'resource'): FormatResu
113117 . trim ( )
114118 . toLowerCase ( )
115119 // Aliasing
116- . replace ( / - ? * p r e [ - ] ? ( r e l e a s e ) ? * / , '-pre' )
120+ . replace ( / - ? * p r e [ - ] ? (?: r e l e a s e ) ? * / , '-pre' )
117121 . replace ( / * r e l e a s e c a n d i d a t e * / , '-rc' )
118- . replace ( / * e x p e r i m e n t a l * s n a p s h o t | - e s / , '-exp' )
122+ . replace ( / * e x p (?: e r i m e n t a l ) ? * (?: s n a p s h o t ) ? | - e s / , '-exp' )
119123
120124 // Special //
121125 for ( const format in SPECIAL [ type ] ) {
122- if ( SPECIAL [ type ] [ format ] . includes ( version ) ) return + format
126+ if ( SPECIAL [ type ] [ format ] . find ( ( ver ) => version . includes ( ver ) ) ) return + format
123127 }
124128
125129 // Snapshot //
@@ -136,11 +140,7 @@ function getPackFormat(version: string, type: PackType = 'resource'): FormatResu
136140 // Release //
137141
138142 if ( version . includes ( '-' ) ) {
139- // Special cases for specific development versions
140- if ( version . includes ( '1.16.2-pre' ) ) return 5
141- if ( version . includes ( '1.18-e' ) ) return 7
142- if ( version . includes ( '1.19.4-pre' ) ) return { data : 12 , resource : 13 } [ type ]
143- // Default to the parent version
143+ // Default to the parent version if it doesn't match the special cases from before
144144 version = version . replace ( / - .+ $ / , '' )
145145 }
146146
0 commit comments