若版本号包含SNAPSHOT则也不更新

通过Gradle构建出来的JAR版本号为3.1.SNAPSHOT这样的
This commit is contained in:
yushijinhun
2018-06-17 13:40:09 +08:00
parent 97132745cc
commit 936a74597f

View File

@@ -78,7 +78,7 @@ public final class UpdateChecker {
@Override
public void execute() throws Exception {
if (Launcher.VERSION.contains("@"))
if (isDevelopmentVersion(Launcher.VERSION))
return;
if (value == null) {
@@ -103,6 +103,11 @@ public final class UpdateChecker {
};
}
private boolean isDevelopmentVersion(String version) {
return version.contains("@") || // eg. @HELLO_MINECRAFT_LAUNCHER_VERSION_FOR_GRADLE_REPLACING@
version.contains("SNAPSHOT"); // eg. 3.1.SNAPSHOT
}
/**
* Get the <b>cached</b> newest version number, use "process" method to
* download!