fix update checker's snapshot versions

This commit is contained in:
Colbster937
2026-01-09 20:20:35 -06:00
parent 1aa22606b2
commit 34226ec549
3 changed files with 5 additions and 4 deletions

View File

@@ -289,7 +289,7 @@ public final class OriginBlacklist {
this.updateAvailable = UpdateChecker.checkForUpdate(PLUGIN_REPO, this.plugin.getPluginVersion(),
this.config.get("update_checker.allow_snapshots").getAsBoolean());
if (this.updateAvailable) {
this.plugin.log(EnumLogLevel.INFO, "Update Available! Download at https://github.com/" + PLUGIN_REPO + ".git");
this.plugin.log(EnumLogLevel.INFO, "An update is available! Download it at https://github.com/" + PLUGIN_REPO + ".git");
}
});
}

View File

@@ -69,8 +69,8 @@ public class OriginBlacklistCommand implements ICommand {
public void usage(CommandContext ctx) {
ctx.reply("<aqua>Commands:</aqua>");
ctx.reply("<gray> - /originblacklist reload</gray>");
//ctx.reply("<gray> - /originblacklist add <brand/origin/name/ip> <value></gray>");
//ctx.reply("<gray> - /originblacklist remove <brand/origin/name/ip> <value></gray>");
// ctx.reply("<gray> - /originblacklist add <brand/origin/name/ip> <value></gray>");
// ctx.reply("<gray> - /originblacklist remove <brand/origin/name/ip> <value></gray>");
ctx.reply("<gray> - /originblacklist list</gray>");
}
}

View File

@@ -6,6 +6,7 @@ import java.net.HttpURLConnection;
import java.net.URL;
import org.semver4j.Semver;
import org.semver4j.Semver.VersionDiff;
import de.marhali.json5.Json5;
import de.marhali.json5.Json5Array;
@@ -33,7 +34,7 @@ public class UpdateChecker {
final Json5Object obj = element.getAsJson5Object();
final String tag = obj.get("tag_name").getAsString();
final Semver ver = new Semver(tag.substring(1));
if (ver.isGreaterThan(currentVersion)) {
if (ver.isGreaterThan(currentVersion) && (allowPreRelease || currentVersion.diff(ver) != VersionDiff.BUILD)) {
return true;
}
}