mirror of
https://github.com/CarmJos/MineSQL.git
synced 2026-06-04 16:43:03 +08:00
chore(deps): 适配上游更新。
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>minesql-parent</artifactId>
|
||||
<groupId>cc.carm.plugin</groupId>
|
||||
<version>1.4.2</version>
|
||||
<version>1.4.3</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@@ -79,13 +79,6 @@
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.byteflux</groupId>
|
||||
<artifactId>libby-bukkit</artifactId>
|
||||
<version>${deps.libby.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.bstats</groupId>
|
||||
<artifactId>bstats-bukkit</artifactId>
|
||||
|
||||
@@ -4,8 +4,6 @@ import cc.carm.lib.easyplugin.EasyPlugin;
|
||||
import cc.carm.plugin.minesql.conf.PluginConfiguration;
|
||||
import co.aikar.commands.CommandManager;
|
||||
import co.aikar.commands.PaperCommandManager;
|
||||
import net.byteflux.libby.BukkitLibraryManager;
|
||||
import net.byteflux.libby.LibraryManager;
|
||||
import org.bstats.bukkit.Metrics;
|
||||
import org.bstats.charts.SimplePie;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -16,8 +14,6 @@ public class MineSQLBukkit extends EasyPlugin implements MineSQLPlatform {
|
||||
|
||||
protected static MineSQLBukkit instance;
|
||||
|
||||
protected BukkitLibraryManager libraryManager;
|
||||
|
||||
protected MineSQLCore core;
|
||||
protected PaperCommandManager commandManager;
|
||||
|
||||
@@ -25,9 +21,6 @@ public class MineSQLBukkit extends EasyPlugin implements MineSQLPlatform {
|
||||
protected void load() {
|
||||
MineSQLBukkit.instance = this;
|
||||
|
||||
log("加载依赖管理器...");
|
||||
this.libraryManager = new BukkitLibraryManager(this);
|
||||
|
||||
log("加载基础核心...");
|
||||
this.core = new MineSQLCore(this);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>minesql-parent</artifactId>
|
||||
<groupId>cc.carm.plugin</groupId>
|
||||
<version>1.4.2</version>
|
||||
<version>1.4.3</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -1,120 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>minesql-parent</artifactId>
|
||||
<groupId>cc.carm.plugin</groupId>
|
||||
<version>1.4.2</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>${project.jdk.version}</maven.compiler.source>
|
||||
<maven.compiler.target>${project.jdk.version}</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
|
||||
<maven.javadoc.skip>true</maven.javadoc.skip>
|
||||
<maven.deploy.skip>true</maven.deploy.skip>
|
||||
</properties>
|
||||
|
||||
<artifactId>minesql-platform-sponge</artifactId>
|
||||
|
||||
<name>MineSQL-Sponge</name>
|
||||
<description>轻松(用)SQL的独立运行库Sponge版本插件。</description>
|
||||
<url>https://github.com/CarmJos/MineSQL</url>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<id>huanmeng</id>
|
||||
<name>huanmeng-qwq</name>
|
||||
<email>huanmeng@huanmeng-qwq.com</email>
|
||||
<roles>
|
||||
<role>Contributor</role>
|
||||
</roles>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<licenses>
|
||||
<license>
|
||||
<name>GNU General Public License v3.0</name>
|
||||
<url>https://opensource.org/licenses/GPL-3.0</url>
|
||||
</license>
|
||||
</licenses>
|
||||
|
||||
<issueManagement>
|
||||
<system>GitHub Issues</system>
|
||||
<url>https://github.com/CarmJos/EasySQL-Plugin/issues</url>
|
||||
</issueManagement>
|
||||
|
||||
<ciManagement>
|
||||
<system>GitHub Actions</system>
|
||||
<url>https://github.com/CarmJos/EasySQL-Plugin/actions/workflows/maven.yml</url>
|
||||
</ciManagement>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>sponge</id>
|
||||
<url>https://repo.spongepowered.org/maven</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!--suppress VulnerableLibrariesLocal -->
|
||||
<dependency>
|
||||
<groupId>${project.parent.groupId}</groupId>
|
||||
<artifactId>minesql-core</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<!--suppress VulnerableLibrariesLocal -->
|
||||
<dependency>
|
||||
<groupId>org.spongepowered</groupId>
|
||||
<artifactId>spongeapi</artifactId>
|
||||
<version>8.0.0</version>
|
||||
<scope>provided</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>ninja.leaping.configurate</groupId>
|
||||
<artifactId>configurate-hocon</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.bstats</groupId>
|
||||
<artifactId>bstats-sponge</artifactId>
|
||||
<version>${deps.bstats.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>co.aikar</groupId>
|
||||
<artifactId>acf-sponge</artifactId>
|
||||
<version>${deps.acf.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -1,122 +0,0 @@
|
||||
package cc.carm.plugin.minesql;
|
||||
|
||||
import cc.carm.lib.easyplugin.utils.ColorParser;
|
||||
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.kyori.adventure.text.Component;
|
||||
import org.bstats.charts.SimplePie;
|
||||
import org.bstats.sponge.Metrics;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.spongepowered.api.Server;
|
||||
import org.spongepowered.api.Sponge;
|
||||
import org.spongepowered.api.config.ConfigDir;
|
||||
import org.spongepowered.api.event.Listener;
|
||||
import org.spongepowered.api.event.Order;
|
||||
import org.spongepowered.api.event.lifecycle.StartingEngineEvent;
|
||||
import org.spongepowered.api.event.lifecycle.StoppingEngineEvent;
|
||||
import org.spongepowered.plugin.PluginContainer;
|
||||
import org.spongepowered.plugin.builtin.jvm.Plugin;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Arrays;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* @author huanmeng_qwq, CarmJos
|
||||
*/
|
||||
@Plugin("minesql")
|
||||
public class MineSQLSponge implements MineSQLPlatform {
|
||||
|
||||
@Inject
|
||||
@ConfigDir(sharedRoot = false)
|
||||
private Path configDirectory;
|
||||
|
||||
@Inject
|
||||
private org.apache.logging.log4j.Logger logger;
|
||||
|
||||
private final PluginContainer pluginContainer;
|
||||
private final Metrics.Factory metricsFactory;
|
||||
|
||||
protected final MineSQLCore core;
|
||||
// protected SpongeCommandManager commandManager;
|
||||
|
||||
@Inject
|
||||
public MineSQLSponge(Metrics.Factory factory, PluginContainer pluginContainer) {
|
||||
this.pluginContainer = pluginContainer;
|
||||
this.metricsFactory = factory;
|
||||
|
||||
getLogger().info("加载基础核心...");
|
||||
this.core = new MineSQLCore(this);
|
||||
}
|
||||
|
||||
@Listener(order = Order.PRE)
|
||||
public void starting(StartingEngineEvent<Server> e) {
|
||||
outputInfo();
|
||||
// getLogger().info("初始化指令管理器...");
|
||||
// this.commandManager = new SpongeCommandManager(pluginContainer);
|
||||
//
|
||||
// getLogger().info("注册相关指令...");
|
||||
// this.core.initializeCommands(getCommandManager());
|
||||
|
||||
if (getConfiguration().METRICS.getNotNull()) {
|
||||
getLogger().info("启用统计数据...");
|
||||
Metrics metrics = this.metricsFactory.make(14078);
|
||||
metrics.addCustomChart(new SimplePie("update_check",
|
||||
() -> getConfiguration().UPDATE_CHECKER.getNotNull() ? "ENABLED" : "DISABLED")
|
||||
);
|
||||
metrics.addCustomChart(new SimplePie("properties_configuration",
|
||||
() -> getConfiguration().PROPERTIES.ENABLE.getNotNull() ? "ENABLED" : "DISABLED")
|
||||
);
|
||||
}
|
||||
|
||||
if (getConfiguration().UPDATE_CHECKER.getNotNull()) {
|
||||
getLogger().info("开始检查更新,可能需要一小段时间...");
|
||||
getLogger().info(" 如不希望检查更新,可在配置文件中关闭。");
|
||||
Sponge.asyncScheduler().executor(pluginContainer)
|
||||
.execute(() -> this.core.checkUpdate(getVersion()));
|
||||
} else {
|
||||
getLogger().info("已禁用检查更新,跳过。");
|
||||
}
|
||||
}
|
||||
|
||||
@Listener
|
||||
public void disable(StoppingEngineEvent<Server> e) {
|
||||
outputInfo();
|
||||
logger.info("终止全部数据库连接...");
|
||||
this.core.shutdownAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull File getPluginFolder() {
|
||||
return configDirectory.toFile();
|
||||
}
|
||||
|
||||
public @NotNull PluginConfiguration getConfiguration() {
|
||||
return this.core.getConfig();
|
||||
}
|
||||
|
||||
public @NotNull java.util.logging.Logger getLogger() {
|
||||
return java.util.logging.Logger.getLogger("MineSQL");
|
||||
}
|
||||
|
||||
//fixme acf-sponge是基于sponge5编写的 无法使用
|
||||
@Override
|
||||
public @Nullable CommandManager<?, ?, ?, ?, ?, ?> getCommandManager() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return pluginContainer.metadata().version().toString();
|
||||
}
|
||||
|
||||
public void outputInfo() {
|
||||
Optional.ofNullable(JarResourceUtils.readResource(this.getClass().getResourceAsStream("PLUGIN_INFO")))
|
||||
.map(v -> ColorParser.parse(Arrays.asList(v)))
|
||||
.ifPresent(list -> list.forEach(s -> Sponge.server().sendMessage(Component.text(s))));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
{
|
||||
"loader": {
|
||||
"name": "java_plain",
|
||||
"version": "1.0"
|
||||
},
|
||||
"license": "GPL-3.0-or-later",
|
||||
"global": {
|
||||
"version": "8.0.0",
|
||||
"links": {
|
||||
"homepage": "${project.url}",
|
||||
"source": "${project.url}",
|
||||
"issues": "${project.url}/issues"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "huanmeng",
|
||||
"description": "ContributorContributor"
|
||||
},
|
||||
{
|
||||
"name": "CarmJos",
|
||||
"description": "Lead Developer"
|
||||
}
|
||||
],
|
||||
"dependencies": [
|
||||
{
|
||||
"id": "spongeapi",
|
||||
"version": "8.0.0"
|
||||
}
|
||||
]
|
||||
},
|
||||
"plugins": [
|
||||
{
|
||||
"id": "minesql",
|
||||
"name": "MineSQL (EasySQL-Plugin)",
|
||||
"entrypoint": "cc.carm.plugin.minesql.MineSQLSponge",
|
||||
"description": "${project.description}"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>minesql-parent</artifactId>
|
||||
<groupId>cc.carm.plugin</groupId>
|
||||
<version>1.4.2</version>
|
||||
<version>1.4.3</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -22,7 +22,8 @@ import java.nio.file.Path;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
|
||||
@Plugin(id = "minesql", name = "MineSQL (EasySQL-Plugin)", version = "1.4.2",
|
||||
@Plugin(id = "minesql", name = "MineSQL (EasySQL-Plugin)",
|
||||
version = References.VERSION,
|
||||
description = "EasySQL Plugin For Velocity",
|
||||
url = "https://github.com/CarmJos/MineSQL",
|
||||
authors = {"CarmJos", "GhostChu"}
|
||||
|
||||
Reference in New Issue
Block a user