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 -> {