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>
|
<groupId>me.skymc</groupId>
|
||||||
<artifactId>TabooLib</artifactId>
|
<artifactId>TabooLib</artifactId>
|
||||||
<version>4.56</version>
|
<version>4.57</version>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
@ -93,6 +93,8 @@ public class Main extends JavaPlugin {
|
|||||||
disable = false;
|
disable = false;
|
||||||
// 载入配置文件
|
// 载入配置文件
|
||||||
saveDefaultConfig();
|
saveDefaultConfig();
|
||||||
|
// 载入扩展
|
||||||
|
TabooLibLoader.setupAddons();
|
||||||
// 载入牛逼东西
|
// 载入牛逼东西
|
||||||
TLib.init();
|
TLib.init();
|
||||||
TLib.injectPluginManager();
|
TLib.injectPluginManager();
|
||||||
|
@ -40,7 +40,6 @@ public class TabooLibLoader implements Listener {
|
|||||||
|
|
||||||
static void setup() {
|
static void setup() {
|
||||||
testInternet();
|
testInternet();
|
||||||
setupAddons();
|
|
||||||
setupDataFolder();
|
setupDataFolder();
|
||||||
setupDatabase();
|
setupDatabase();
|
||||||
setupLibraries();
|
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())));
|
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() {
|
static void setupDataFolder() {
|
||||||
Main.setPlayerDataFolder(FileUtils.folder(Main.getInst().getConfig().getString("DATAURL.PLAYER-DATA")));
|
Main.setPlayerDataFolder(FileUtils.folder(Main.getInst().getConfig().getString("DATAURL.PLAYER-DATA")));
|
||||||
Main.setServerDataFolder(FileUtils.folder(Main.getInst().getConfig().getString("DATAURL.SERVER-DATA")));
|
Main.setServerDataFolder(FileUtils.folder(Main.getInst().getConfig().getString("DATAURL.SERVER-DATA")));
|
||||||
@ -116,6 +107,14 @@ public class TabooLibLoader implements Listener {
|
|||||||
TabooLibDatabase.init();
|
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() {
|
static void setupLibraries() {
|
||||||
if (Main.isOfflineVersion()) {
|
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 -> {
|
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