File tree Expand file tree Collapse file tree
app_pojavlauncher/src/main/java/net/kdt/pojavlaunch Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1537,11 +1537,16 @@ public static Integer mcVersiontoInt(String mcVersion){
15371537 String [] iVersionArray = new String [3 ];
15381538 // Make sure this is actually a version string
15391539 for (int i = 0 ; i < iVersionArray .length ; i ++) {
1540- // Ensure there's padding
1541- sVersionArray [i ] = String .format ("%3s" , sVersionArray [i ]).replace (' ' , '0' );
1542- System .out .println (sVersionArray [i ]);
1543- // Grab only the last 3, MCJE 999.999.999 isnt coming soon anyway
1544- sVersionArray [i ] = sVersionArray [i ].substring (sVersionArray [i ].length () - 3 );
1540+ try {
1541+ // Ensure there's padding
1542+ sVersionArray [i ] = String .format ("%3s" , sVersionArray [i ]).replace (' ' , '0' );
1543+ // Grab only the last 3, MCJE 999.999.999 isnt coming soon anyway
1544+ sVersionArray [i ] = sVersionArray [i ].substring (sVersionArray [i ].length () - 3 );
1545+ } catch (ArrayIndexOutOfBoundsException ignored ){
1546+ // If we don't get 3 a third array, pad with 0s because it's probably 1.21 or something
1547+ iVersionArray [i ] = "000" ;
1548+ continue ;
1549+ }
15451550 try {
15461551 // Verify its a real deal, legit number
15471552 Integer .parseInt (sVersionArray [i ]);
You can’t perform that action at this time.
0 commit comments