TabooLib v4.57
+ 修复插件因载入顺序错误导致开服报错的问题
This commit is contained in:
parent
423ad56f0c
commit
2bcc82aa15
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>me.skymc</groupId>
|
||||
<artifactId>TabooLib</artifactId>
|
||||
<version>4.56</version>
|
||||
<version>4.57</version>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
@ -93,6 +93,8 @@ public class Main extends JavaPlugin {
|
||||
disable = false;
|
||||
// 载入配置文件
|
||||
saveDefaultConfig();
|
||||
// 载入扩展
|
||||
TabooLibLoader.setupAddons();
|
||||
// 载入牛逼东西
|
||||
TLib.init();
|
||||
TLib.injectPluginManager();
|
||||
|
@ -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 -> {
|
||||
|
Loading…
Reference in New Issue
Block a user