Fixed plugin min version requirement comparison

This commit is contained in:
RaphiMC 2023-04-23 23:28:53 +02:00
parent 189971038d
commit 9c0ce3b45a

View File

@ -82,7 +82,7 @@ public class PluginManager {
if (!yaml.containsKey("version")) throw new IllegalStateException("Plugin '" + file.getName() + "' does not have a version attribute in the viaproxy.yml");
if (!yaml.containsKey("main")) throw new IllegalStateException("Plugin '" + file.getName() + "' does not have a main attribute in the viaproxy.yml");
Semver minVersion = new Semver(yaml.getOrDefault("min-version", "0.0.0").toString());
if (!ViaProxy.VERSION.equals("${version}") && minVersion.isLowerThan(new Semver(ViaProxy.VERSION))) {
if (!ViaProxy.VERSION.equals("${version}") && minVersion.isGreaterThan(ViaProxy.VERSION)) {
throw new IllegalStateException("Plugin '" + file.getName() + "' requires a newer version of ViaProxy (v" + minVersion + ")");
}