Fix for backport updating
This commit is contained in:
parent
c755e7f9a4
commit
fafcc58eef
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-bin.zip
|
||||
|
@ -89,7 +89,7 @@ public class KCauldronUpdater implements Runnable {
|
||||
boolean quite = MinecraftServer.kcauldronConfig.updatecheckerQuite
|
||||
.getValue();
|
||||
MinecraftServer server = MinecraftServer.getServer();
|
||||
final String filename = "KCauldron-" + mVersion + "-server.jar";
|
||||
final String filename = KCauldron.getChannel() + "-" + mVersion + "-server.jar";
|
||||
File path = KCauldron.getServerLocation();
|
||||
File newPath = new File(path.getParentFile(),
|
||||
getInstallAs(filename));
|
||||
@ -124,6 +124,9 @@ public class KCauldronUpdater implements Runnable {
|
||||
.addParameter("port", "" + server.getPort()).build();
|
||||
HttpResponse response = HttpClientBuilder.create()
|
||||
.setUserAgent("KCauldron Updater").build().execute(request);
|
||||
if (response.getStatusLine().getStatusCode() != 200) {
|
||||
throw new IllegalStateException("Could not download new version");
|
||||
}
|
||||
InputStream is = response.getEntity().getContent();
|
||||
Files.copy(is, newPath.toPath());
|
||||
if (mSender != null && !quite) {
|
||||
|
Loading…
Reference in New Issue
Block a user