mirror of
https://github.com/CarmJos/MineSQL.git
synced 2026-06-13 21:01:08 +08:00
Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c2c5e0656d | |||
| e6bbe36cb1 | |||
| b49c46ffe8 | |||
| 06f7a2607b | |||
| 66396c0c27 | |||
| e3ef67e342 | |||
| 9ba9b1f5d1 | |||
| 31aa49a60b | |||
| 1e2b18026a | |||
| 1013501fda | |||
| 3e30a83484 | |||
| 83936ee53e | |||
| 7a1216e624 | |||
| 24530e1f50 | |||
| a22d9bd797 | |||
| 62a8bc4629 | |||
| 40afd988e4 | |||
| fff84fafae | |||
| e6fad85438 |
@@ -29,13 +29,17 @@ jobs:
|
||||
run: mvn -B package --file pom.xml -Dgpg.skip
|
||||
|
||||
- name: "Upload artifacts"
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: artifacts
|
||||
path: "**/target/"
|
||||
retention-days: 5
|
||||
include-hidden-files: true
|
||||
|
||||
- name: "Upload assets"
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: assets
|
||||
path: ".asset/"
|
||||
path: ".asset/"
|
||||
retention-days: 5
|
||||
include-hidden-files: true
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>minesql-parent</artifactId>
|
||||
<groupId>cc.carm.plugin</groupId>
|
||||
<version>1.3.1</version>
|
||||
<version>1.4.2</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
+19
-20
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>minesql-parent</artifactId>
|
||||
<groupId>cc.carm.plugin</groupId>
|
||||
<version>1.3.1</version>
|
||||
<version>1.4.2</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<properties>
|
||||
@@ -80,6 +80,24 @@
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mariadb.jdbc</groupId>
|
||||
<artifactId>mariadb-java-client</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cc.carm.lib</groupId>
|
||||
<artifactId>easyplugin-githubchecker</artifactId>
|
||||
@@ -101,25 +119,6 @@
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mariadb.jdbc</groupId>
|
||||
<artifactId>mariadb-java-client</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<!--suppress VulnerableLibrariesLocal -->
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -15,13 +15,13 @@ import cc.carm.plugin.minesql.command.MineSQLHelpFormatter;
|
||||
import cc.carm.plugin.minesql.conf.PluginConfiguration;
|
||||
import cc.carm.plugin.minesql.conf.SQLSourceGroup;
|
||||
import cc.carm.plugin.minesql.util.DBPropertiesUtil;
|
||||
import cn.beecp.BeeDataSource;
|
||||
import cn.beecp.BeeDataSourceConfig;
|
||||
import co.aikar.commands.CommandManager;
|
||||
import co.aikar.commands.InvalidCommandArgument;
|
||||
import co.aikar.commands.Locales;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.stone.beecp.BeeDataSource;
|
||||
import org.stone.beecp.BeeDataSourceConfig;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.io.File;
|
||||
@@ -111,7 +111,7 @@ public class MineSQLCore implements IMineSQL {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull SQLManagerImpl create(@NotNull String name, @NotNull SQLSourceConfig conf) {
|
||||
public @NotNull SQLManagerImpl create(@NotNull String name, @NotNull SQLSourceConfig conf) throws Exception {
|
||||
BeeDataSourceConfig config = new BeeDataSourceConfig();
|
||||
config.setDriverClassName(conf.getDriverClassName());
|
||||
config.setJdbcUrl(conf.getJdbcURL());
|
||||
@@ -130,11 +130,16 @@ public class MineSQLCore implements IMineSQL {
|
||||
Optional.ofNullable(conf.getSettings().getReadOnly()).ifPresent(config::setDefaultReadOnly);
|
||||
Optional.ofNullable(conf.getSettings().getSchema()).ifPresent(config::setDefaultSchema);
|
||||
|
||||
Optional.ofNullable(conf.getSettings().getValidationSQL()).ifPresent(config::setValidTestSql);
|
||||
Optional.ofNullable(conf.getSettings().getValidationTimeout()).ifPresent(config::setValidTestTimeout);
|
||||
Optional.ofNullable(conf.getSettings().getValidationInterval()).ifPresent(config::setValidAssumeTime);
|
||||
Optional.ofNullable(conf.getSettings().getValidationSQL()).ifPresent(config::setAliveTestSql);
|
||||
Optional.ofNullable(conf.getSettings().getValidationTimeout()).ifPresent(config::setAliveTestTimeout);
|
||||
Optional.ofNullable(conf.getSettings().getValidationInterval()).ifPresent(config::setTimerCheckInterval);
|
||||
|
||||
return create(name, config);
|
||||
SQLManagerImpl manager = create(name, config);
|
||||
if (conf.getInitializer() != null) {
|
||||
conf.getInitializer().accept(manager);
|
||||
}
|
||||
|
||||
return manager;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,6 +3,7 @@ package cc.carm.plugin.minesql.command;
|
||||
import cc.carm.lib.easysql.api.SQLManager;
|
||||
import cc.carm.lib.easysql.api.SQLQuery;
|
||||
import cc.carm.plugin.minesql.MineSQLCore;
|
||||
import cc.carm.plugin.minesql.lib.PluginLibraries;
|
||||
import cc.carm.plugin.minesql.util.VersionReader;
|
||||
import co.aikar.commands.BaseCommand;
|
||||
import co.aikar.commands.CommandHelp;
|
||||
@@ -42,7 +43,7 @@ public class MineSQLCommand extends BaseCommand {
|
||||
issuer.sendMessage("§c只有后台执行才能使用此命令。");
|
||||
return;
|
||||
}
|
||||
VersionReader reader = new VersionReader();
|
||||
VersionReader reader = PluginLibraries.READER;
|
||||
String pluginVersion = reader.get("plugin", null);
|
||||
if (pluginVersion == null) {
|
||||
issuer.sendMessage("§c无法获取当前版本信息,请保证使用原生版本以避免安全问题。");
|
||||
@@ -50,9 +51,9 @@ public class MineSQLCommand extends BaseCommand {
|
||||
}
|
||||
issuer.sendMessage("§r当前插件版本为 §b" + pluginVersion + "§r。 §7(基于 EasySQL &3" + reader.get("api") + "&7)");
|
||||
issuer.sendMessage("§8 - &f连接池依赖 BeeCP §9" + reader.get("beecp"));
|
||||
issuer.sendMessage("§8 - &f数据库驱动 MySQL §9" + reader.get("mysql-driver"));
|
||||
issuer.sendMessage("§8 - &f数据库驱动 MariaDB §9" + reader.get("mariadb-driver"));
|
||||
issuer.sendMessage("§8 - &f数据库驱动 h2-database §9" + reader.get("h2-driver"));
|
||||
issuer.sendMessage("§8 - &f数据库驱动 MySQL §9" + PluginLibraries.MYSQL_DRIVER.getVersion());
|
||||
issuer.sendMessage("§8 - &f数据库驱动 MariaDB §9" + PluginLibraries.MARIADB_DRIVER.getVersion());
|
||||
issuer.sendMessage("§8 - &f数据库驱动 h2-database §9" + PluginLibraries.H2_DRIVER.getVersion());
|
||||
|
||||
issuer.sendMessage("§r正在检查插件更新,请稍候...");
|
||||
core.checkUpdate(pluginVersion);
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package cc.carm.plugin.minesql.lib;
|
||||
|
||||
import cc.carm.plugin.minesql.util.VersionReader;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public enum PluginLibraries {
|
||||
|
||||
BEECP("com.github.chris2018998", "beecp"),
|
||||
H2_DRIVER("com.h2database", "h2"),
|
||||
MYSQL_DRIVER("com.mysql", "mysql-connector-j"),
|
||||
MARIADB_DRIVER("org.mariadb.jdbc", "mariadb-java-client");
|
||||
|
||||
public static final VersionReader READER = new VersionReader();
|
||||
|
||||
private final @NotNull String groupID;
|
||||
private final @NotNull String artifactID;
|
||||
|
||||
PluginLibraries(@NotNull String groupID, @NotNull String artifactID) {
|
||||
this.groupID = groupID;
|
||||
this.artifactID = artifactID;
|
||||
}
|
||||
|
||||
public @NotNull String getVersion() {
|
||||
return READER.get(name().toLowerCase().replace('_', '-'));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -17,7 +17,7 @@ public class DBPropertiesUtil {
|
||||
if (!propertiesFolder.exists() || !propertiesFolder.isDirectory()) return propertiesMap;
|
||||
|
||||
File[] files = propertiesFolder.listFiles();
|
||||
if (files == null || files.length == 0) return propertiesMap;
|
||||
if (files == null) return propertiesMap;
|
||||
for (File file : files) {
|
||||
if (!validateName(file.getName())) continue;
|
||||
String name = file.getName().substring(0, file.getName().lastIndexOf("."));
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
package cc.carm.plugin.minesql.util;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.Properties;
|
||||
|
||||
public class MavenReadUtil {
|
||||
|
||||
public static String getMavenPropertiesPath(@NotNull String groupID, @NotNull String artifactID) {
|
||||
return String.format("/META-INF/maven/%s/%s/pom.properties", groupID, artifactID);
|
||||
}
|
||||
|
||||
public static synchronized @Nullable String getVersion(@NotNull Object provider,
|
||||
@NotNull String groupID,
|
||||
@NotNull String artifactID) {
|
||||
String path = getMavenPropertiesPath(groupID, artifactID);
|
||||
String version = null;
|
||||
// Using maven properties to get the version
|
||||
try (InputStream is = provider.getClass().getResourceAsStream(path)) {
|
||||
if (is != null) {
|
||||
Properties p = new Properties();
|
||||
p.load(is);
|
||||
version = p.getProperty("version", "");
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
|
||||
if (version != null) return version;
|
||||
|
||||
// Fine, lets try Java API
|
||||
Package pkg = provider.getClass().getPackage();
|
||||
if (pkg != null) {
|
||||
version = pkg.getImplementationVersion();
|
||||
if (version == null) {
|
||||
version = pkg.getSpecificationVersion();
|
||||
}
|
||||
}
|
||||
|
||||
return version;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>minesql-parent</artifactId>
|
||||
<groupId>cc.carm.plugin</groupId>
|
||||
<version>1.3.1</version>
|
||||
<version>1.4.2</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@@ -79,17 +79,24 @@
|
||||
<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>
|
||||
<version>3.0.0</version>
|
||||
<version>${deps.bstats.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>co.aikar</groupId>
|
||||
<artifactId>acf-paper</artifactId>
|
||||
<version>0.5.1-SNAPSHOT</version>
|
||||
<version>${deps.acf.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -4,10 +4,11 @@ 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;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@@ -15,6 +16,8 @@ public class MineSQLBukkit extends EasyPlugin implements MineSQLPlatform {
|
||||
|
||||
protected static MineSQLBukkit instance;
|
||||
|
||||
protected BukkitLibraryManager libraryManager;
|
||||
|
||||
protected MineSQLCore core;
|
||||
protected PaperCommandManager commandManager;
|
||||
|
||||
@@ -22,6 +25,9 @@ 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);
|
||||
}
|
||||
@@ -75,7 +81,7 @@ public class MineSQLBukkit extends EasyPlugin implements MineSQLPlatform {
|
||||
return this.core.getConfig();
|
||||
}
|
||||
|
||||
public @Nullable CommandManager<?, ?, ?, ?, ?, ?> getCommandManager() {
|
||||
public @NotNull CommandManager<?, ?, ?, ?, ?, ?> getCommandManager() {
|
||||
return commandManager;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>minesql-parent</artifactId>
|
||||
<groupId>cc.carm.plugin</groupId>
|
||||
<version>1.3.1</version>
|
||||
<version>1.4.2</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@@ -56,15 +56,6 @@
|
||||
<url>https://github.com/CarmJos/MineSQL/actions/workflows/maven.yml</url>
|
||||
</ciManagement>
|
||||
|
||||
<repositories>
|
||||
|
||||
<repository>
|
||||
<id>bungeecord-repo</id>
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
||||
</repository>
|
||||
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
@@ -75,32 +66,23 @@
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.md-5</groupId>
|
||||
<artifactId>bungeecord-api</artifactId>
|
||||
<version>1.16-R0.5-SNAPSHOT</version>
|
||||
<type>jar</type>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.md-5</groupId>
|
||||
<artifactId>bungeecord-api</artifactId>
|
||||
<version>1.16-R0.5-SNAPSHOT</version>
|
||||
<type>javadoc</type>
|
||||
<groupId>io.github.waterfallmc</groupId>
|
||||
<artifactId>waterfall-api</artifactId>
|
||||
<version>1.21-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.bstats</groupId>
|
||||
<artifactId>bstats-bungeecord</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<version>${deps.bstats.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>co.aikar</groupId>
|
||||
<artifactId>acf-bungee</artifactId>
|
||||
<version>0.5.1-SNAPSHOT</version>
|
||||
<version>${deps.acf.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ import net.md_5.bungee.api.plugin.Plugin;
|
||||
import org.bstats.bungeecord.Metrics;
|
||||
import org.bstats.charts.SimplePie;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
@@ -89,7 +88,7 @@ public class MineSQLBungee extends Plugin implements MineSQLPlatform {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable CommandManager<?, ?, ?, ?, ?, ?> getCommandManager() {
|
||||
public @NotNull CommandManager<?, ?, ?, ?, ?, ?> getCommandManager() {
|
||||
return this.commandManager;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>minesql-parent</artifactId>
|
||||
<groupId>cc.carm.plugin</groupId>
|
||||
<version>1.3.1</version>
|
||||
<version>1.4.2</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@@ -87,15 +87,14 @@
|
||||
<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>
|
||||
|
||||
|
||||
@@ -45,8 +45,7 @@ public class MineSQLSponge implements MineSQLPlatform {
|
||||
// protected SpongeCommandManager commandManager;
|
||||
|
||||
@Inject
|
||||
public MineSQLSponge(Metrics.Factory factory,
|
||||
PluginContainer pluginContainer) {
|
||||
public MineSQLSponge(Metrics.Factory factory, PluginContainer pluginContainer) {
|
||||
this.pluginContainer = pluginContainer;
|
||||
this.metricsFactory = factory;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>minesql-parent</artifactId>
|
||||
<groupId>cc.carm.plugin</groupId>
|
||||
<version>1.3.1</version>
|
||||
<version>1.4.2</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@@ -85,13 +85,15 @@
|
||||
<dependency>
|
||||
<groupId>org.bstats</groupId>
|
||||
<artifactId>bstats-velocity</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<version>${deps.bstats.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>co.aikar</groupId>
|
||||
<artifactId>acf-velocity</artifactId>
|
||||
<version>0.5.1-SNAPSHOT</version>
|
||||
<version>${deps.acf.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
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 co.aikar.commands.VelocityCommandManager;
|
||||
@@ -16,20 +13,16 @@ import com.velocitypowered.api.plugin.PluginContainer;
|
||||
import com.velocitypowered.api.plugin.PluginDescription;
|
||||
import com.velocitypowered.api.plugin.annotation.DataDirectory;
|
||||
import com.velocitypowered.api.proxy.ProxyServer;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bstats.charts.SimplePie;
|
||||
import org.bstats.velocity.Metrics;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Arrays;
|
||||
import java.util.Optional;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
|
||||
@Plugin(id = "minesql", name = "MineSQL (EasySQL-Plugin)", version = "1.3.1",
|
||||
@Plugin(id = "minesql", name = "MineSQL (EasySQL-Plugin)", version = "1.4.2",
|
||||
description = "EasySQL Plugin For Velocity",
|
||||
url = "https://github.com/CarmJos/MineSQL",
|
||||
authors = {"CarmJos", "GhostChu"}
|
||||
@@ -60,7 +53,8 @@ public class MineSQLVelocity implements MineSQLPlatform {
|
||||
|
||||
@Subscribe(order = PostOrder.FIRST)
|
||||
public void onInitialize(ProxyInitializeEvent event) {
|
||||
outputInfo();
|
||||
|
||||
|
||||
getLogger().info("初始化指令管理器...");
|
||||
this.commandManager = new VelocityCommandManager(server, this);
|
||||
|
||||
@@ -90,7 +84,6 @@ public class MineSQLVelocity implements MineSQLPlatform {
|
||||
|
||||
@Subscribe(order = PostOrder.LAST)
|
||||
public void onShutdown(ProxyShutdownEvent event) {
|
||||
outputInfo();
|
||||
getLogger().info("终止全部数据库连接...");
|
||||
this.core.shutdownAll();
|
||||
}
|
||||
@@ -114,20 +107,12 @@ public class MineSQLVelocity implements MineSQLPlatform {
|
||||
return this.dataFolder;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public @Nullable CommandManager<?, ?, ?, ?, ?, ?> getCommandManager() {
|
||||
public @NotNull CommandManager<?, ?, ?, ?, ?, ?> getCommandManager() {
|
||||
return commandManager;
|
||||
}
|
||||
|
||||
public @NotNull PluginConfiguration getConfiguration() {
|
||||
return this.core.getConfig();
|
||||
}
|
||||
|
||||
public void outputInfo() {
|
||||
Optional.ofNullable(JarResourceUtils.readResource(this.getClass().getResourceAsStream("PLUGIN_INFO")))
|
||||
.map(v -> ColorParser.parse(Arrays.asList(v)))
|
||||
.ifPresent(list -> list.forEach(s -> getServer().getConsoleCommandSource().sendMessage(Component.text(s))));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+12
-53
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>minesql-parent</artifactId>
|
||||
<groupId>cc.carm.plugin</groupId>
|
||||
<version>1.3.1</version>
|
||||
<version>1.4.2</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<properties>
|
||||
@@ -80,86 +80,45 @@
|
||||
<relocations>
|
||||
<relocation>
|
||||
<pattern>org.bstats</pattern>
|
||||
<shadedPattern>cc.carm.plugin.minesql.lib.bstats</shadedPattern>
|
||||
<shadedPattern>${code.package}.lib.bstats</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>org.json</pattern>
|
||||
<shadedPattern>cc.carm.plugin.minesql.lib.json</shadedPattern>
|
||||
<shadedPattern>${code.package}.lib.json</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>cc.carm.lib.easyplugin</pattern>
|
||||
<shadedPattern>cc.carm.plugin.minesql.lib.easyplugin</shadedPattern>
|
||||
<shadedPattern>${code.package}.lib.easyplugin</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>cc.carm.lib.githubreleases4j</pattern>
|
||||
<shadedPattern>cc.carm.plugin.minesql.lib.githubreleases4j</shadedPattern>
|
||||
<shadedPattern>${code.package}.lib.githubreleases4j</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>cc.carm.lib.configuration</pattern>
|
||||
<shadedPattern>cc.carm.plugin.minesql.lib.configuration</shadedPattern>
|
||||
<shadedPattern>${code.package}.lib.configuration</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>org.bspfsystems.yamlconfiguration</pattern>
|
||||
<shadedPattern>cc.carm.plugin.minesql.lib.configuration.yaml
|
||||
</shadedPattern> <!-- Replace this -->
|
||||
<shadedPattern>${code.package}.lib.configuration.yaml</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>org.yaml.snakeyaml</pattern>
|
||||
<shadedPattern>cc.carm.plugin.minesql.lib.yaml</shadedPattern> <!-- Replace this -->
|
||||
<shadedPattern>${code.package}.lib.yaml</shadedPattern> <!-- Replace this -->
|
||||
</relocation>
|
||||
|
||||
<relocation>
|
||||
<pattern>co.aikar.commands</pattern>
|
||||
<shadedPattern>cc.carm.plugin.minesql.lib.acf</shadedPattern> <!-- Replace this -->
|
||||
<shadedPattern>${code.package}.lib.acf</shadedPattern> <!-- Replace this -->
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>co.aikar.locales</pattern>
|
||||
<shadedPattern>cc.carm.plugin.minesql.lib.locales</shadedPattern> <!-- Replace this -->
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>cn.beecp</pattern>
|
||||
<shadedPattern>cc.carm.plugin.minesql.lib.beecp</shadedPattern> <!-- Replace this -->
|
||||
<shadedPattern>${code.package}.lib.locales</shadedPattern> <!-- Replace this -->
|
||||
</relocation>
|
||||
|
||||
<relocation>
|
||||
<pattern>org.h2</pattern>
|
||||
<shadedPattern>cc.carm.plugin.minesql.driver.h2</shadedPattern> <!-- Replace this -->
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>org.mariadb</pattern>
|
||||
<shadedPattern>cc.carm.plugin.minesql.driver.mariadb</shadedPattern> <!-- Replace this -->
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>com.mysql</pattern>
|
||||
<shadedPattern>cc.carm.plugin.minesql.driver.mysql</shadedPattern> <!-- Replace this -->
|
||||
</relocation>
|
||||
|
||||
<relocation>
|
||||
<pattern>com.sun.jna</pattern>
|
||||
<shadedPattern>cc.carm.plugin.minesql.lib.jna</shadedPattern> <!-- Replace this -->
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>com.google.protobuf</pattern>
|
||||
<shadedPattern>cc.carm.plugin.minesql.lib.google.protobuf
|
||||
</shadedPattern> <!-- Replace this -->
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>com.google.errorprone</pattern>
|
||||
<shadedPattern>cc.carm.plugin.minesql.lib.google.errorprone
|
||||
</shadedPattern> <!-- Replace this -->
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>com.github</pattern>
|
||||
<shadedPattern>cc.carm.plugin.minesql.lib.github</shadedPattern> <!-- Replace this -->
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>org.checkerframework</pattern>
|
||||
<shadedPattern>cc.carm.plugin.minesql.lib.checkerframework
|
||||
</shadedPattern> <!-- Replace this -->
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>waffle</pattern>
|
||||
<shadedPattern>cc.carm.plugin.minesql.lib.waffle</shadedPattern> <!-- Replace this -->
|
||||
<pattern>net.byteflux.libby</pattern>
|
||||
<shadedPattern>${code.package}.lib.libby</shadedPattern>
|
||||
</relocation>
|
||||
|
||||
</relocations>
|
||||
|
||||
@@ -11,20 +11,26 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
|
||||
|
||||
<deps.easysql.version>0.4.6</deps.easysql.version>
|
||||
<deps.easyconf.version>3.3.1</deps.easyconf.version>
|
||||
<deps.easyplugin.version>1.4.18</deps.easyplugin.version>
|
||||
<deps.beecp.version>3.3.9</deps.beecp.version>
|
||||
<deps.easysql.version>0.4.7</deps.easysql.version>
|
||||
<deps.easyconf.version>3.5.1</deps.easyconf.version>
|
||||
<deps.easyplugin.version>1.5.12</deps.easyplugin.version>
|
||||
<deps.beecp.version>4.1.7</deps.beecp.version>
|
||||
|
||||
<deps.mysql-driver.version>8.0.31</deps.mysql-driver.version>
|
||||
<deps.libby.version>1.1.5</deps.libby.version>
|
||||
<deps.acf.version>0.5.1-SNAPSHOT</deps.acf.version>
|
||||
<deps.bstats.version>3.0.0</deps.bstats.version>
|
||||
|
||||
<deps.mysql-driver.version>8.2.0</deps.mysql-driver.version>
|
||||
<deps.mariadb-driver.version>3.1.0</deps.mariadb-driver.version>
|
||||
<deps.h2-driver.version>2.1.214</deps.h2-driver.version>
|
||||
<deps.h2-driver.version>2.2.220</deps.h2-driver.version>
|
||||
|
||||
<code.package>cc.carm.plugin.minesql</code.package>
|
||||
</properties>
|
||||
|
||||
<groupId>cc.carm.plugin</groupId>
|
||||
<artifactId>minesql-parent</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.3.1</version>
|
||||
<version>1.4.2</version>
|
||||
<modules>
|
||||
<module>api</module>
|
||||
<module>core</module>
|
||||
@@ -117,7 +123,7 @@
|
||||
<dependency>
|
||||
<groupId>org.jetbrains</groupId>
|
||||
<artifactId>annotations</artifactId>
|
||||
<version>23.1.0</version>
|
||||
<version>24.0.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -150,7 +156,7 @@
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>31.0.1-jre</version>
|
||||
<version>32.0.0-jre</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client -->
|
||||
@@ -162,8 +168,8 @@
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
<version>${deps.mysql-driver.version}</version>
|
||||
</dependency>
|
||||
|
||||
@@ -198,7 +204,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.22.1</version>
|
||||
<version>2.22.2</version>
|
||||
<configuration>
|
||||
<useSystemClassLoader>false</useSystemClassLoader>
|
||||
</configuration>
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"config:recommended"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user