From c327a8d3021b04d2b71b9bb307a9d0ff0d49bebf Mon Sep 17 00:00:00 2001 From: 502647092 Date: Tue, 16 Aug 2016 13:47:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=8F=92=E4=BB=B6=E9=87=8D=E8=BD=BD?= =?UTF-8?q?=E6=97=B6=E6=9C=AA=E8=BD=BD=E5=85=A5=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 502647092 --- src/main/java/pw/yumc/YumCore/statistic/Statistics.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/pw/yumc/YumCore/statistic/Statistics.java b/src/main/java/pw/yumc/YumCore/statistic/Statistics.java index 89d64bc..4ca22cd 100644 --- a/src/main/java/pw/yumc/YumCore/statistic/Statistics.java +++ b/src/main/java/pw/yumc/YumCore/statistic/Statistics.java @@ -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();