+ 照顾一下网络查的,不堵塞下载了

This commit is contained in:
坏黑 2018-09-26 21:41:04 +08:00
parent 0c9d263965
commit 4b32b545d6

View File

@ -70,10 +70,12 @@ public class UpdateTask {
TLocale.Logger.info("COMMANDS.TABOOLIB.UPDATEPLUGIN.FILE-NOT-FOUND"); TLocale.Logger.info("COMMANDS.TABOOLIB.UPDATEPLUGIN.FILE-NOT-FOUND");
return; return;
} }
FileUtils.download("https://github.com/Bkm016/TabooLib/releases/download/" + newVersion + "/TabooLib-" + newVersion + ".jar", pluginFile); Bukkit.getScheduler().runTaskAsynchronously(TabooLib.instance(), () -> {
TLocale.Logger.info("COMMANDS.TABOOLIB.UPDATEPLUGIN.UPDATE-SUCCESS"); FileUtils.download("https://github.com/Bkm016/TabooLib/releases/download/" + newVersion + "/TabooLib-" + newVersion + ".jar", pluginFile);
if (shutdown) { TLocale.Logger.info("COMMANDS.TABOOLIB.UPDATEPLUGIN.UPDATE-SUCCESS");
Bukkit.shutdown(); if (shutdown) {
} Bukkit.shutdown();
}
});
} }
} }