From b8ab5ebc1a4e4187ae5bc6355ce2087825b1a1b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=9D=8F=E9=BB=91?= Date: Sun, 4 Nov 2018 15:42:10 +0800 Subject: [PATCH] + TabooLibLoader fixed. --- src/main/java/me/skymc/taboolib/TabooLibLoader.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/skymc/taboolib/TabooLibLoader.java b/src/main/java/me/skymc/taboolib/TabooLibLoader.java index 6a7333c..9f13fde 100644 --- a/src/main/java/me/skymc/taboolib/TabooLibLoader.java +++ b/src/main/java/me/skymc/taboolib/TabooLibLoader.java @@ -39,6 +39,7 @@ public class TabooLibLoader implements Listener { static Map> pluginClasses = Maps.newHashMap(); static List loaders = Lists.newArrayList(); static List tasks = Lists.newArrayList(); + static boolean started; static void setup() { testInternet(); @@ -91,7 +92,11 @@ public class TabooLibLoader implements Listener { } public static void runTaskOnEnabled(Runnable runnable) { - tasks.add(runnable); + if (Main.isStarted()) { + runnable.run(); + } else { + tasks.add(runnable); + } } static boolean isLoader(Class pluginClass) {