From 2bcc82aa15134b3b77565fae1c7ec654ece2933d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=9D=8F=E9=BB=91?= Date: Sun, 21 Oct 2018 13:57:45 +0800 Subject: [PATCH] =?UTF-8?q?TabooLib=20v4.57=20+=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E5=9B=A0=E8=BD=BD=E5=85=A5=E9=A1=BA=E5=BA=8F?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E5=AF=BC=E8=87=B4=E5=BC=80=E6=9C=8D=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- src/main/java/me/skymc/taboolib/Main.java | 2 ++ .../java/me/skymc/taboolib/TabooLibLoader.java | 17 ++++++++--------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/pom.xml b/pom.xml index 529ccd0..2a05cb2 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ me.skymc TabooLib - 4.56 + 4.57 UTF-8 diff --git a/src/main/java/me/skymc/taboolib/Main.java b/src/main/java/me/skymc/taboolib/Main.java index e977c0e..3debae8 100644 --- a/src/main/java/me/skymc/taboolib/Main.java +++ b/src/main/java/me/skymc/taboolib/Main.java @@ -93,6 +93,8 @@ public class Main extends JavaPlugin { disable = false; // 载入配置文件 saveDefaultConfig(); + // 载入扩展 + TabooLibLoader.setupAddons(); // 载入牛逼东西 TLib.init(); TLib.injectPluginManager(); diff --git a/src/main/java/me/skymc/taboolib/TabooLibLoader.java b/src/main/java/me/skymc/taboolib/TabooLibLoader.java index 6664f14..8e0a08d 100644 --- a/src/main/java/me/skymc/taboolib/TabooLibLoader.java +++ b/src/main/java/me/skymc/taboolib/TabooLibLoader.java @@ -40,7 +40,6 @@ public class TabooLibLoader implements Listener { static void setup() { testInternet(); - setupAddons(); setupDataFolder(); setupDatabase(); setupLibraries(); @@ -97,14 +96,6 @@ public class TabooLibLoader implements Listener { metrics.addCustomChart(new Metrics.SingleLineChart("plugins_using_taboolib", () -> Math.toIntExact(Arrays.stream(Bukkit.getPluginManager().getPlugins()).filter(plugin -> plugin.getDescription().getDepend().contains("TabooLib")).count()))); } - static void setupAddons() { - TabooLib.instance().saveResource("Addons/TabooLibDeprecated.jar", true); - File file = new File(TabooLib.instance().getDataFolder(), "Addons"); - if (file.exists()) { - Arrays.stream(file.listFiles()).forEach(listFile -> TDependencyLoader.addToPath(TabooLib.instance(), listFile)); - } - } - static void setupDataFolder() { Main.setPlayerDataFolder(FileUtils.folder(Main.getInst().getConfig().getString("DATAURL.PLAYER-DATA"))); Main.setServerDataFolder(FileUtils.folder(Main.getInst().getConfig().getString("DATAURL.SERVER-DATA"))); @@ -116,6 +107,14 @@ public class TabooLibLoader implements Listener { TabooLibDatabase.init(); } + static void setupAddons() { + TabooLib.instance().saveResource("Addons/TabooLibDeprecated.jar", true); + File file = new File(TabooLib.instance().getDataFolder(), "Addons"); + if (file.exists()) { + Arrays.stream(file.listFiles()).forEach(listFile -> TDependencyLoader.addToPath(TabooLib.instance(), listFile)); + } + } + static void setupLibraries() { if (Main.isOfflineVersion()) { Arrays.stream(TDependencyInjector.getDependencies(TLib.getTLib())).filter(dependency -> dependency.type() == Dependency.Type.LIBRARY && dependency.maven().matches(".*:.*:.*")).map(dependency -> String.join("-", dependency.maven().split(":")) + ".jar").forEach(fileName -> {