diff --git a/src/main/java/me/itzg/helpers/forge/NeoForgeInstallerResolver.java b/src/main/java/me/itzg/helpers/forge/NeoForgeInstallerResolver.java index ed063a59..85c0e336 100644 --- a/src/main/java/me/itzg/helpers/forge/NeoForgeInstallerResolver.java +++ b/src/main/java/me/itzg/helpers/forge/NeoForgeInstallerResolver.java @@ -106,6 +106,7 @@ else if (requestedNeoForgeVersion == null || requestedNeoForgeVersion.equalsIgno .allMatch(i -> parts[i].equals(neoforgeVersion[i])); } else { + // specific minecraft version if (minecraftVersion != null) { // minor.patch of minecraft version != major.minor of neoforge version final String minor = minecraftVersion[1]; @@ -116,11 +117,13 @@ else if (requestedNeoForgeVersion == null || requestedNeoForgeVersion.equalsIgno } } - if (parts.length >= 4 && parts[3].equals("beta")) { - return neoForgeVersionType == NeoForgeVersionType.BETA; + // If requesting a beta, then only match a beta version + if (neoForgeVersionType == NeoForgeVersionType.BETA) { + return parts.length >= 4 && parts[3].equals("beta"); + } + else { + return parts.length == 3; } - - return true; } }) .reduce((s, s2) -> s2) diff --git a/src/test/java/me/itzg/helpers/forge/NeoForgeInstallerResolverTest.java b/src/test/java/me/itzg/helpers/forge/NeoForgeInstallerResolverTest.java index bb2b7139..ad880f3e 100644 --- a/src/test/java/me/itzg/helpers/forge/NeoForgeInstallerResolverTest.java +++ b/src/test/java/me/itzg/helpers/forge/NeoForgeInstallerResolverTest.java @@ -19,15 +19,17 @@ class NeoForgeInstallerResolverTest { public static Stream resolve_args() { return Stream.of( - arguments("1.20.4", "beta", "1.20.4", "20.4.62-beta"), - arguments("1.20.4", "latest", null, null), + arguments("1.20.4", "beta", "1.20.4", "20.4.166-beta"), + arguments("1.21.4", "latest", null, null), arguments("1.20.2", "latest", "1.20.2", "20.2.88"), - arguments("1.20.2", "beta", "1.20.2", "20.2.88"), + arguments("1.20.2", "beta", "1.20.2", "20.2.85-beta"), arguments("1.20.3", "beta", "1.20.3", "20.3.8-beta"), arguments("latest", "20.2.85-beta", "1.20.2", "20.2.85-beta"), arguments("latest", "20.2.88", "1.20.2", "20.2.88"), arguments("1.20.1", "latest", "1.20.1", "47.1.84"), - arguments("1.21", "beta", "1.21", "21.0.42-beta") + arguments("1.21", "beta", "1.21", "21.0.142-beta"), + arguments("latest", "beta", "1.21.4", "21.4.48-beta"), + arguments("latest", "latest", "1.21.1", "21.1.93") ); } @@ -67,4 +69,5 @@ void resolve(String minecraftVersion, String neoforgeVersion, } } + } \ No newline at end of file diff --git a/src/test/resources/__files/forge/neoforged-neoforge-maven-metadata.xml b/src/test/resources/__files/forge/neoforged-neoforge-maven-metadata.xml index 0805e7f4..b74a57c5 100644 --- a/src/test/resources/__files/forge/neoforged-neoforge-maven-metadata.xml +++ b/src/test/resources/__files/forge/neoforged-neoforge-maven-metadata.xml @@ -3,8 +3,8 @@ net.neoforged neoforge - 20.4.62-beta - 20.4.62-beta + 21.1.93 + 21.1.93 20.2.3-beta 20.2.4-beta @@ -147,10 +147,676 @@ 20.2.88 20.4.61-beta 20.4.62-beta + 20.4.63-beta + 20.4.64-beta + 20.4.65-beta + 20.4.66-beta + 20.4.67-beta + 20.4.68-beta + 20.4.69-beta + 20.4.70-beta + 20.4.71-beta + 20.4.72-beta + 20.4.73-beta + 20.4.74-beta + 20.4.75-beta + 20.4.76-beta + 20.4.77-beta + 20.4.78-beta + 20.4.79-beta + 20.4.80-beta + 20.4.81-beta + 20.4.82-beta + 20.4.83-beta + 20.4.84-beta + 20.4.85-beta + 20.4.87-beta + 20.4.88-beta + 20.4.89-beta + 20.4.91-beta + 20.4.92-beta + 20.4.93-beta + 20.4.94-beta + 20.4.95-beta + 20.4.96-beta + 20.4.97-beta + 20.4.98-beta + 20.4.99-beta + 20.4.100-beta + 20.4.101-beta + 20.4.102-beta + 20.4.103-beta + 20.4.104-beta + 20.4.105-beta + 20.4.106-beta + 20.4.107-beta + 20.4.108-beta + 20.4.109-beta + 20.4.111-beta + 20.4.112-beta + 20.4.113-beta + 20.4.114-beta + 20.4.115-beta + 20.4.116-beta + 20.4.117-beta + 20.4.118-beta + 20.4.119-beta + 20.4.120-beta + 20.4.121-beta + 20.4.122-beta + 20.4.123-beta + 20.4.124-beta + 20.4.125-beta + 20.4.126-beta + 20.4.127-beta + 20.4.128-beta + 20.4.129-beta + 20.4.130-beta + 20.4.131-beta + 20.4.132-beta + 20.4.133-beta + 20.4.134-beta + 20.4.135-beta + 20.4.136-beta + 20.4.137-beta + 20.4.138-beta + 20.4.139-beta + 20.4.140-beta + 20.4.141-beta + 20.4.142-beta + 20.4.143-beta + 20.4.144-beta + 20.4.145-beta + 20.4.146-beta + 20.4.147-beta + 20.4.148-beta + 20.4.149-beta + 20.4.150-beta + 20.4.151-beta + 20.4.152-beta + 20.4.153-beta + 20.4.154-beta + 20.4.155-beta + 20.4.156-beta + 20.4.157-beta + 20.4.158-beta + 20.4.159-beta + 20.4.160-beta + 20.4.161-beta + 20.4.162-beta + 20.4.163-beta + 20.4.164-beta + 20.4.165-beta + 20.4.166-beta + 20.4.167 + 20.4.169 + 20.4.170 + 20.4.171 + 20.4.172 + 20.4.173 + 20.4.174 + 20.4.175 + 20.4.176 + 20.4.177 + 20.4.178 + 20.4.179 + 20.4.180 + 20.4.181 + 20.4.182 + 20.4.183 + 20.4.184 + 20.4.185 + 20.4.186 + 20.4.187 + 20.4.188 + 20.4.189 + 20.4.190 + 20.4.191 + 20.4.192 + 20.4.193 + 20.4.194 + 20.4.195 + 20.4.196 + 20.4.197 + 20.4.198 + 20.4.199 + 20.4.200 + 20.4.201 + 20.4.202 + 20.4.203 + 20.4.204 + 20.4.205 + 20.4.206 + 20.4.207 + 20.4.208 + 20.4.209 + 20.4.210 + 20.4.211 + 20.4.212 + 20.4.213 + 20.4.214 + 20.4.215 + 20.4.216 + 20.4.217 + 20.4.218 + 20.4.219 + 20.4.221 + 20.4.222 + 20.4.223 + 20.4.224 + 20.4.225 + 20.4.226 + 20.4.227 + 20.4.228 + 20.4.229 + 20.4.230 + 20.4.231 + 20.4.232 + 20.5.0-beta + 20.5.1-beta + 20.5.2-beta + 20.5.3-beta + 20.4.233 + 20.5.4-beta + 20.5.5-beta + 20.5.6-beta + 20.5.7-beta + 20.5.8-beta + 20.5.9-beta + 20.5.10-beta + 20.5.11-beta + 20.5.12-beta + 20.5.13-beta + 20.5.14-beta + 20.5.15-beta + 20.5.16-beta + 20.5.17-beta + 20.5.18-beta + 20.5.19-beta + 20.5.20-beta + 20.5.21-beta + 20.6.1-beta + 20.6.2-beta + 20.6.3-beta + 20.6.4-beta + 20.4.234 + 20.6.5-beta + 20.6.6-beta + 20.6.7-beta + 20.6.8-beta + 20.6.9-beta + 20.6.10-beta + 20.6.11-beta + 20.6.12-beta + 20.6.13-beta + 20.6.14-beta + 20.6.15-beta + 20.6.16-beta + 20.6.17-beta + 20.6.18-beta + 20.6.19-beta + 20.6.20-beta + 20.6.21-beta + 20.6.22-beta + 20.6.23-beta + 20.6.24-beta + 20.6.25-beta + 20.6.26-beta + 20.6.27-beta + 20.6.28-beta + 20.6.30-beta + 20.6.29-beta + 20.6.31-beta + 20.6.32-beta + 20.6.39-beta + 20.6.40-beta + 20.6.41-beta + 20.6.42-beta + 20.6.43-beta + 20.6.44-beta + 20.6.47-beta + 20.6.45-beta + 20.6.46-beta + 20.6.48-beta + 20.6.49-beta + 20.6.50-beta + 20.6.51-beta + 20.6.52-beta + 20.6.53-beta + 20.6.55-beta + 20.6.54-beta + 20.6.56-beta + 20.6.57-beta + 20.6.59-beta + 20.6.60-beta + 20.6.61-beta + 20.6.62-beta + 20.6.63-beta + 20.6.66-beta + 20.6.68-beta + 20.6.67-beta + 20.6.69-beta + 20.6.70-beta + 20.6.71-beta + 20.6.72-beta + 20.6.73-beta + 20.6.74-beta + 20.6.75-beta + 20.6.76-beta + 20.6.77-beta + 20.6.78-beta + 20.6.80-beta + 20.6.79-beta + 20.6.81-beta + 20.6.82-beta + 20.4.235 + 20.6.83-beta + 20.6.84-beta + 20.6.85-beta + 20.6.87-beta + 20.6.88-beta + 20.6.89-beta + 20.6.91-beta + 20.6.90-beta + 20.6.92-beta + 20.6.93-beta + 20.6.95-beta + 20.6.94-beta + 20.6.96-beta + 20.6.97-beta + 20.6.98-beta + 20.6.99-beta + 20.6.100-beta + 20.6.103-beta + 20.6.104-beta + 20.6.105-beta + 20.6.106-beta + 20.6.107-beta + 20.6.108-beta + 20.6.109-beta + 20.6.110-beta + 20.6.111-beta + 20.4.236 + 20.6.112-beta + 20.4.237 + 20.6.113-beta + 20.6.114-beta + 20.6.115 + 20.6.116 + 21.0.0-beta + 21.0.1-beta + 21.0.2-beta + 21.0.3-beta + 21.0.4-beta + 20.6.117 + 21.0.5-beta + 21.0.6-beta + 21.0.8-beta + 21.0.7-beta + 20.6.118 + 21.0.9-beta + 21.0.10-beta 20.6.119 + 21.0.11-beta + 21.0.12-beta + 21.0.13-beta + 21.0.14-beta + 21.0.15-beta + 21.0.16-beta + 21.0.17-beta + 21.0.18-beta + 21.0.19-beta + 21.0.20-beta + 21.0.21-beta + 21.0.22-beta + 21.0.23-beta + 21.0.24-beta + 21.0.25-beta + 21.0.26-beta + 21.0.27-beta + 21.0.28-beta + 21.0.29-beta + 21.0.30-beta + 21.0.31-beta + 21.0.32-beta + 21.0.33-beta + 21.0.35-beta + 21.0.36-beta + 21.0.37-beta + 21.0.38-beta + 21.0.39-beta + 21.0.40-beta 21.0.41-beta 21.0.42-beta + 21.0.43-beta + 21.0.44-beta + 21.0.45-beta + 21.0.46-beta + 21.0.47-beta + 21.0.48-beta + 21.0.49-beta + 21.0.50-beta + 21.0.51-beta + 21.0.52-beta + 21.0.53-beta + 21.0.54-beta + 21.0.55-beta + 21.0.56-beta + 21.0.57-beta + 21.0.58-beta + 21.0.59-beta + 21.0.60-beta + 21.0.61-beta + 21.0.62-beta + 21.0.63-beta + 21.0.64-beta + 21.0.65-beta + 21.0.66-beta + 21.0.67-beta + 21.0.68-beta + 21.0.69-beta + 21.0.70-beta + 21.0.71-beta + 21.0.72-beta + 21.0.74-beta + 21.0.73-beta + 21.0.75-beta + 21.0.76-beta + 21.0.77-beta + 21.0.78-beta + 21.0.79-beta + 21.0.80-beta + 21.0.81-beta + 21.0.82-beta + 21.0.83-beta + 21.0.84-beta + 21.0.85-beta + 21.0.86-beta + 21.0.87-beta + 21.0.88-beta + 21.0.89-beta + 21.0.90-beta + 21.0.91-beta + 21.0.92-beta + 21.0.93-beta + 21.0.94-beta + 21.0.95-beta + 21.0.96-beta + 21.0.97-beta + 21.0.98-beta + 21.0.99-beta + 21.0.101-beta + 21.0.100-beta + 21.0.102-beta + 21.0.103-beta + 21.0.105-beta + 21.0.104-beta + 21.0.106-beta + 21.0.108-beta + 21.0.109-beta + 21.0.107-beta + 21.0.110-beta + 21.0.111-beta + 21.0.112-beta + 21.0.113-beta + 21.0.114-beta + 21.0.115-beta + 21.0.116-beta + 21.0.117-beta + 21.0.118-beta + 21.0.119-beta + 21.0.120-beta + 21.0.121-beta + 21.0.122-beta + 21.0.123-beta + 21.0.124-beta + 21.0.125-beta + 21.0.126-beta + 21.0.127-beta + 21.0.128-beta + 21.0.129-beta + 21.0.130-beta + 21.0.131-beta + 21.0.132-beta + 21.0.133-beta + 21.0.134-beta + 21.0.135-beta + 21.0.136-beta + 21.0.137-beta + 21.0.138-beta + 21.0.139-beta + 21.0.140-beta + 21.0.141-beta + 21.0.142-beta + 21.0.143 + 21.0.144 + 21.0.145 + 21.0.146 + 21.0.147 + 21.0.148 + 21.0.149 + 21.0.150 + 21.0.151 + 21.0.152 + 21.0.153 + 21.0.154 + 21.0.157 + 21.0.158 + 21.0.159 + 21.0.160 + 21.0.161 + 21.0.162 + 21.0.163 + 21.0.164 + 21.0.165 + 21.0.166 + 21.0.167 + 21.1.1 + 21.1.2 + 21.1.3 + 21.1.4 + 21.1.5 + 21.1.6 + 21.1.7 + 21.1.8 + 21.1.9 + 21.1.10 + 21.1.11 + 21.1.12 + 21.1.13 + 21.1.15 + 21.1.16 + 21.1.17 + 21.1.18 + 21.1.19 + 21.1.20 + 21.1.21 + 21.1.22 + 21.1.23 + 21.1.24 + 21.1.25 + 21.1.26 + 21.1.27 + 21.1.28 + 21.1.29 + 21.1.30 + 20.6.120 + 21.1.31 + 21.1.32 + 21.1.33 + 21.1.34 + 20.6.121 + 21.1.35 + 21.1.36 + 21.1.37 + 21.1.39 + 21.1.40 + 21.1.41 + 21.1.42 + 21.1.43 + 21.1.44 + 21.1.45 + 21.1.46 + 21.1.47 + 21.1.48 + 21.1.49 + 21.1.50 + 21.1.51 + 21.1.52 + 21.1.53 + 21.1.54 + 21.1.55 + 21.1.56 + 21.1.57 + 21.1.58 + 21.1.59 + 21.1.60 + 21.1.61 + 21.1.62 + 21.1.63 + 21.1.64 + 21.1.65 + 21.1.66 + 21.1.68 + 21.1.69 + 21.1.70 + 21.1.71 + 21.1.72 + 21.2.0-beta + 21.2.1-beta + 21.3.0-beta + 21.3.1-beta + 21.3.2-beta + 21.3.3-beta + 21.1.73 + 21.3.4-beta + 21.3.5-beta + 21.3.6-beta + 21.3.7-beta + 21.3.8-beta + 21.3.9-beta + 21.3.10-beta + 21.3.11-beta + 21.1.74 + 21.3.12-beta + 21.3.13-beta + 21.3.14-beta + 21.1.75 + 21.3.15-beta + 21.3.16-beta + 21.1.76 + 21.3.17-beta + 21.3.18-beta + 21.3.19-beta + 21.3.22-beta + 21.3.20-beta + 21.3.23-beta + 21.3.24-beta + 21.3.21-beta + 21.3.25-beta + 21.3.26-beta + 21.1.77 + 21.3.27-beta + 21.3.28-beta + 21.3.29-beta + 21.3.30-beta + 21.1.78 + 21.3.31-beta + 21.1.79 + 21.3.32-beta + 21.3.33-beta + 21.3.34-beta + 21.1.80 + 21.3.35-beta + 21.3.36-beta + 21.3.37-beta + 21.3.38-beta + 21.3.39-beta + 21.3.40-beta + 21.3.41-beta + 21.1.81 + 21.3.42-beta + 21.3.43-beta + 21.3.44-beta + 21.3.45-beta + 21.3.46-beta + 21.3.47-beta + 21.3.48-beta + 21.1.82 + 21.3.49-beta + 21.1.83 + 21.3.50-beta + 21.3.51-beta + 21.3.52-beta + 21.3.53-beta + 21.3.54-beta + 21.3.55-beta + 21.3.56 + 21.3.57 + 21.4.0-beta + 21.4.1-beta + 21.4.2-beta + 21.4.3-beta + 21.4.4-beta + 21.4.5-beta + 21.4.6-beta + 21.4.7-beta + 21.4.8-beta + 21.1.84 + 21.4.9-beta + 21.4.10-beta + 21.1.85 + 21.4.11-beta + 21.4.12-beta + 21.4.13-beta + 21.4.14-beta + 21.1.86 + 21.4.15-beta + 21.4.16-beta + 21.1.87 + 21.1.88 + 21.4.17-beta + 21.3.58 + 21.1.89 + 21.4.18-beta + 21.4.19-beta + 21.4.20-beta + 21.4.21-beta + 21.4.22-beta + 21.4.23-beta + 21.4.24-beta + 21.1.90 + 21.4.25-beta + 21.4.26-beta + 21.4.27-beta + 20.6.122 + 21.4.28-beta + 21.4.29-beta + 21.4.30-beta + 20.4.238 + 21.4.33-beta + 21.4.34-beta + 21.4.35-beta + 21.4.36-beta + 21.4.37-beta + 21.4.38-beta + 21.4.39-beta + 21.4.40-beta + 21.4.41-beta + 21.4.42-beta + 21.4.43-beta + 20.6.123 + 21.4.44-beta + 21.4.45-beta + 21.4.46-beta + 21.1.91 + 21.1.92 + 21.4.47-beta + 20.6.124 + 20.4.239 + 21.4.48-beta + 21.1.93 - 20231228145256 + 20250103121454