feat: 添加 lettuce-core 用于连接 redis
All checks were successful
Publish Project / build (push) Successful in 2m43s
All checks were successful
Publish Project / build (push) Successful in 2m43s
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
@file:Suppress("VulnerableLibrariesLocal")
|
||||
|
||||
evaluationDependsOn(":core-common")
|
||||
evaluationDependsOn(":core-relocate-lettuce")
|
||||
|
||||
val shade = configurations.create("shade")
|
||||
|
||||
dependencies {
|
||||
api(project(":core-common")) { isTransitive = false }
|
||||
@@ -10,26 +13,31 @@ dependencies {
|
||||
compileOnly("org.black_ixx:playerpoints:3.2.6") { isTransitive = false }
|
||||
compileOnly("me.clip:placeholderapi:2.11.5") { isTransitive = false }
|
||||
|
||||
// https://www.spigotmc.org/resources/nbt-api.7939/
|
||||
implementation("de.tr7zw:item-nbt-api:2.15.1")
|
||||
|
||||
api("net.kyori:adventure-platform-bukkit:4.3.2") {
|
||||
exclude(group = "org.jetbrains")
|
||||
exclude(group = "com.google.code.gson")
|
||||
exclude(group = "io.netty")
|
||||
}
|
||||
api("net.kyori:adventure-text-minimessage:4.15.0") {
|
||||
exclude(module = "adventure-api")
|
||||
exclude(group = "org.jetbrains")
|
||||
exclude(group = "io.netty")
|
||||
}
|
||||
// https://mvnrepository.com/artifact/redis.clients/jedis
|
||||
|
||||
implementation("com.zaxxer:HikariCP:4.0.3") { exclude(group = "org.slf4j") }
|
||||
api("redis.clients:jedis:5.1.4") {
|
||||
exclude(group = "com.google.code.gson")
|
||||
exclude(group = "org.slf4j")
|
||||
}
|
||||
|
||||
// https://www.spigotmc.org/resources/nbt-api.7939/
|
||||
implementation("de.tr7zw:item-nbt-api:2.13.2")
|
||||
// https://mvnrepository.com/artifact/com.zaxxer/HikariCP
|
||||
implementation("com.zaxxer:HikariCP:4.0.3") { exclude(group = "org.slf4j") }
|
||||
compileOnlyApi("io.lettuce:lettuce-core:6.7.1.RELEASE") {
|
||||
exclude(group = "org.slf4j")
|
||||
exclude(group = "io.netty")
|
||||
}
|
||||
shade(project(":core-relocate-lettuce"))
|
||||
}
|
||||
|
||||
tasks {
|
||||
processResources {
|
||||
filesMatching("plugin.yml") {
|
||||
@@ -40,6 +48,13 @@ tasks {
|
||||
archiveBaseName = "HamsterCore-Bukkit"
|
||||
}
|
||||
shadowJar {
|
||||
dependsOn(":core-relocate-lettuce:shadowJar")
|
||||
val task = project(":core-relocate-lettuce").tasks.shadowJar.get()
|
||||
from(task.outputs.files.map {
|
||||
if (it.isDirectory) it else zipTree(
|
||||
it
|
||||
)
|
||||
})
|
||||
destinationDirectory = rootProject.layout.buildDirectory
|
||||
relocate("de.tr7zw.changeme.nbtapi", "cn.hamster3.mc.plugin.core.lib.de.tr7zw.nbtapi")
|
||||
relocate("de.tr7zw.annotations", "cn.hamster3.mc.plugin.core.lib.de.tr7zw.nbtapi.annotations")
|
||||
|
@@ -132,6 +132,7 @@ public class HamsterCorePlugin extends JavaPlugin {
|
||||
long start = System.currentTimeMillis();
|
||||
if (CoreAPI.getInstance().isEnableRedis()) {
|
||||
CoreAPI.getInstance().getJedisPool().close();
|
||||
CoreAPI.getInstance().getRedisClient().close();
|
||||
simpleLogger.info("已关闭 Redis 连接池");
|
||||
}
|
||||
if (CoreAPI.getInstance().isEnableDatabase()) {
|
||||
|
Reference in New Issue
Block a user