Compare commits

..

1 Commits

Author SHA1 Message Date
Colbster937
34226ec549 fix update checker's snapshot versions 2026-01-09 20:20:35 -06:00
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.updateAvailable = UpdateChecker.checkForUpdate(PLUGIN_REPO, this.plugin.getPluginVersion(),
this.config.get("update_checker.allow_snapshots").getAsBoolean()); this.config.get("update_checker.allow_snapshots").getAsBoolean());
if (this.updateAvailable) { 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) { public void usage(CommandContext ctx) {
ctx.reply("<aqua>Commands:</aqua>"); ctx.reply("<aqua>Commands:</aqua>");
ctx.reply("<gray> - /originblacklist reload</gray>"); ctx.reply("<gray> - /originblacklist reload</gray>");
//ctx.reply("<gray> - /originblacklist add <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 remove <brand/origin/name/ip> <value></gray>");
ctx.reply("<gray> - /originblacklist list</gray>"); ctx.reply("<gray> - /originblacklist list</gray>");
} }
} }

View File

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