mirror of
https://github.com/CarmJos/MineSQL.git
synced 2026-06-05 09:01:42 +08:00
feat(lib): 独立数据库依赖加载,缩减文件体积。
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>minesql-parent</artifactId>
|
||||
<groupId>cc.carm.plugin</groupId>
|
||||
<version>1.3.1</version>
|
||||
<version>1.4.0</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@@ -84,18 +84,24 @@
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.byteflux</groupId>
|
||||
<artifactId>libby-sponge</artifactId>
|
||||
<version>${deps.libby.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.bstats</groupId>
|
||||
<artifactId>bstats-sponge</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<optional>true</optional>
|
||||
<version>${deps.bstats.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>co.aikar</groupId>
|
||||
<artifactId>acf-sponge</artifactId>
|
||||
<version>0.5.1-SNAPSHOT</version>
|
||||
<version>${deps.acf.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@ import cc.carm.lib.easyplugin.utils.JarResourceUtils;
|
||||
import cc.carm.plugin.minesql.conf.PluginConfiguration;
|
||||
import co.aikar.commands.CommandManager;
|
||||
import com.google.inject.Inject;
|
||||
import net.byteflux.libby.LibraryManager;
|
||||
import net.byteflux.libby.SpongeLibraryManager;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bstats.charts.SimplePie;
|
||||
import org.bstats.sponge.Metrics;
|
||||
@@ -41,14 +43,17 @@ public class MineSQLSponge implements MineSQLPlatform {
|
||||
private final PluginContainer pluginContainer;
|
||||
private final Metrics.Factory metricsFactory;
|
||||
|
||||
protected final SpongeLibraryManager<MineSQLSponge> libraryManager;
|
||||
protected final MineSQLCore core;
|
||||
// protected SpongeCommandManager commandManager;
|
||||
|
||||
@Inject
|
||||
public MineSQLSponge(Metrics.Factory factory,
|
||||
PluginContainer pluginContainer) {
|
||||
PluginContainer pluginContainer,
|
||||
SpongeLibraryManager<MineSQLSponge> libraryManager) {
|
||||
this.pluginContainer = pluginContainer;
|
||||
this.metricsFactory = factory;
|
||||
this.libraryManager = libraryManager;
|
||||
|
||||
getLogger().info("加载基础核心...");
|
||||
this.core = new MineSQLCore(this);
|
||||
@@ -110,6 +115,11 @@ public class MineSQLSponge implements MineSQLPlatform {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull LibraryManager getLibraryManager() {
|
||||
return this.libraryManager;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return pluginContainer.metadata().version().toString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user