mirror of
https://e.coding.net/circlecloud/Yum.git
synced 2024-12-23 05:08:47 +00:00
contorl download info output fix plugin load...
This commit is contained in:
parent
1e209f0d45
commit
04e6faa6be
@ -141,19 +141,23 @@ public class DownloadManager {
|
||||
byte[] data = new byte[1024];
|
||||
long downloaded = 0L;
|
||||
int count;
|
||||
long time = System.currentTimeMillis();
|
||||
while ((count = in.read(data)) != -1) {
|
||||
downloaded += count;
|
||||
fout.write(data, 0, count);
|
||||
int percent = (int) (downloaded * 100L / fileLength);
|
||||
if (percent % 10 == 0) {
|
||||
sender.sendMessage(String.format("§6已下载: §a" + getPer(percent / 10) + " %s%%", percent));
|
||||
if (fileLength < 102400 || System.currentTimeMillis() - time > 1000) {
|
||||
sender.sendMessage(String.format("§6已下载: §a" + getPer(percent / 10) + " %s%%", percent));
|
||||
time = System.currentTimeMillis();
|
||||
}
|
||||
}
|
||||
}
|
||||
sender.sendMessage("§6文件: §a" + file.getName() + " 下载完成!");
|
||||
return true;
|
||||
} catch (Exception ex) {
|
||||
sender.sendMessage("§6异常: §c" + ex.getMessage());
|
||||
sender.sendMessage("§6文件: §c" + file.getName() + "下载失败!");
|
||||
ex.printStackTrace();
|
||||
return false;
|
||||
} finally {
|
||||
try {
|
||||
|
@ -307,13 +307,20 @@ public class PluginsManager {
|
||||
try {
|
||||
target = Bukkit.getPluginManager().loadPlugin(pluginFile);
|
||||
} catch (InvalidDescriptionException e) {
|
||||
sender.sendMessage("§4异常: §c" + e.getMessage() + " 插件: " + name + " 的plugin.yml文件存在错误!");
|
||||
sender.sendMessage("§4异常: §c" + e.getMessage());
|
||||
sender.sendMessage("§c插件: " + name + " 的plugin.yml文件存在错误!");
|
||||
return false;
|
||||
} catch (UnsupportedClassVersionError e) {
|
||||
sender.sendMessage("§4异常: §c" + e.getMessage());
|
||||
sender.sendMessage("§c服务器或JAVA的版本低于插件: " + name + " 所需要的版本!!");
|
||||
return false;
|
||||
} catch (InvalidPluginException e) {
|
||||
sender.sendMessage("§4异常: §c" + e.getMessage() + " 文件: " + name + " 不是一个可载入的插件!");
|
||||
sender.sendMessage("§4异常: §c" + e.getMessage());
|
||||
sender.sendMessage("§c文件: " + name + " 不是一个可载入的插件!");
|
||||
return false;
|
||||
} catch (UnknownDependencyException e) {
|
||||
sender.sendMessage("§4异常: §c" + e.getMessage() + " 插件: " + name + " 缺少部分依赖项目!");
|
||||
sender.sendMessage("§4异常: §c" + e.getMessage());
|
||||
sender.sendMessage("§c插件: " + name + " 缺少部分依赖项目!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user