1
0
mirror of https://e.coding.net/circlecloud/YumCore.git synced 2024-12-25 07:08:52 +00:00

fix: 插件重载时未载入异常

Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
502647092 2016-08-16 13:47:10 +08:00
parent 19528cdf65
commit c327a8d302

View File

@ -29,8 +29,6 @@ import org.bukkit.scheduler.BukkitTask;
import org.json.simple.JSONObject;
import org.json.simple.JSONValue;
import pw.yumc.YumCore.bukkit.P;
/**
* Yum数据中心 数据统计类
*
@ -73,7 +71,7 @@ public class Statistics {
}
}
}
final Object pluginClassLoader = P.class.getClassLoader();
final Object pluginClassLoader = Statistics.class.getClassLoader();
final Field field = pluginClassLoader.getClass().getDeclaredField("plugin");
field.setAccessible(true);
plugin = (JavaPlugin) field.get(pluginClassLoader);
@ -216,7 +214,7 @@ public class Statistics {
* @return 是否运行成功.
*/
public boolean start() {
if (task != null) {
if (task != null || !plugin.isEnabled()) {
return true;
}
timer = new StatisticsTimer();