Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
0b8614fec9 | |||
b9be8e4b0b | |||
594bdf15b6 | |||
d16602a06d | |||
ad216ef89b |
@@ -17,12 +17,11 @@ jobs:
|
|||||||
java-version: 21
|
java-version: 21
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
cache: gradle
|
cache: gradle
|
||||||
cache-dependency-path: gradle/wrapper/gradle-wrapper.properties
|
|
||||||
- name: Build Project
|
- name: Build Project
|
||||||
env:
|
env:
|
||||||
ORG_GRADLE_PROJECT_MAVEN_AIRGAME_USERNAME: ${{ secrets.MAVEN_AIRGAME_USERNAME }}
|
ORG_GRADLE_PROJECT_MAVEN_AIRGAME_USERNAME: ${{ secrets.MAVEN_AIRGAME_USERNAME }}
|
||||||
ORG_GRADLE_PROJECT_MAVEN_AIRGAME_PASSWORD: ${{ secrets.MAVEN_AIRGAME_PASSWORD }}
|
ORG_GRADLE_PROJECT_MAVEN_AIRGAME_PASSWORD: ${{ secrets.MAVEN_AIRGAME_PASSWORD }}
|
||||||
run: chmod +x gradlew && ./gradlew build publish --no-daemon
|
run: chmod +x gradlew && ./gradlew build publish --console plain --no-daemon
|
||||||
- name: Publish to Release
|
- name: Publish to Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
|
@@ -24,9 +24,9 @@ repositories {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// 对于 Bukkit 插件
|
// 对于 Bukkit 插件
|
||||||
compileOnly("cn.hamster3.mc.plugin:core-bukkit:1.4.0")
|
compileOnly("cn.hamster3.mc.plugin:core-bukkit:1.4.2")
|
||||||
// 对于 BungeeCord 插件
|
// 对于 BungeeCord 插件
|
||||||
compileOnly("cn.hamster3.mc.plugin:core-bungee:1.4.0")
|
compileOnly("cn.hamster3.mc.plugin:core-bungee:1.4.2")
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -52,13 +52,13 @@ dependencies {
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.hamster3.mc.plugin</groupId>
|
<groupId>cn.hamster3.mc.plugin</groupId>
|
||||||
<artifactId>core-bukkit</artifactId>
|
<artifactId>core-bukkit</artifactId>
|
||||||
<version>1.4.0</version>
|
<version>1.4.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--对于 BungeeCord 插件-->
|
<!--对于 BungeeCord 插件-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.hamster3.mc.plugin</groupId>
|
<groupId>cn.hamster3.mc.plugin</groupId>
|
||||||
<artifactId>core-bungee</artifactId>
|
<artifactId>core-bungee</artifactId>
|
||||||
<version>1.4.0</version>
|
<version>1.4.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
@@ -5,7 +5,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "cn.hamster3.mc.plugin"
|
group = "cn.hamster3.mc.plugin"
|
||||||
version = "1.4.0"
|
version = "1.4.2"
|
||||||
description = "叁只仓鼠的 Minecraft 插件开发通用工具包"
|
description = "叁只仓鼠的 Minecraft 插件开发通用工具包"
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
|
@@ -50,11 +50,7 @@ tasks {
|
|||||||
shadowJar {
|
shadowJar {
|
||||||
dependsOn(":core-relocate-lettuce:shadowJar")
|
dependsOn(":core-relocate-lettuce:shadowJar")
|
||||||
val task = project(":core-relocate-lettuce").tasks.shadowJar.get()
|
val task = project(":core-relocate-lettuce").tasks.shadowJar.get()
|
||||||
from(task.outputs.files.map {
|
from(task.outputs.files.map { if (it.isDirectory) it else zipTree(it) })
|
||||||
if (it.isDirectory) it else zipTree(
|
|
||||||
it
|
|
||||||
)
|
|
||||||
})
|
|
||||||
destinationDirectory = rootProject.layout.buildDirectory
|
destinationDirectory = rootProject.layout.buildDirectory
|
||||||
relocate("de.tr7zw.changeme.nbtapi", "cn.hamster3.mc.plugin.core.lib.de.tr7zw.nbtapi")
|
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")
|
relocate("de.tr7zw.annotations", "cn.hamster3.mc.plugin.core.lib.de.tr7zw.nbtapi.annotations")
|
||||||
|
@@ -130,6 +130,8 @@ public class HamsterCorePlugin extends JavaPlugin {
|
|||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
|
audienceProvider.close();
|
||||||
|
simpleLogger.info("已关闭 AudienceProvider.");
|
||||||
if (CoreAPI.getInstance().isEnableRedis()) {
|
if (CoreAPI.getInstance().isEnableRedis()) {
|
||||||
CoreAPI.getInstance().getJedisPool().close();
|
CoreAPI.getInstance().getJedisPool().close();
|
||||||
CoreAPI.getInstance().getRedisClient().close();
|
CoreAPI.getInstance().getRedisClient().close();
|
||||||
|
@@ -4,7 +4,8 @@ import cn.hamster3.mc.plugin.core.bukkit.HamsterCorePlugin;
|
|||||||
import cn.hamster3.mc.plugin.core.bukkit.command.ParentCommand;
|
import cn.hamster3.mc.plugin.core.bukkit.command.ParentCommand;
|
||||||
import cn.hamster3.mc.plugin.core.bukkit.constant.CoreMessage;
|
import cn.hamster3.mc.plugin.core.bukkit.constant.CoreMessage;
|
||||||
import cn.hamster3.mc.plugin.core.bukkit.util.CoreBukkitUtils;
|
import cn.hamster3.mc.plugin.core.bukkit.util.CoreBukkitUtils;
|
||||||
import de.tr7zw.changeme.nbtapi.*;
|
import de.tr7zw.changeme.nbtapi.NBT;
|
||||||
|
import de.tr7zw.changeme.nbtapi.NBTType;
|
||||||
import de.tr7zw.changeme.nbtapi.iface.ReadWriteNBT;
|
import de.tr7zw.changeme.nbtapi.iface.ReadWriteNBT;
|
||||||
import de.tr7zw.changeme.nbtapi.iface.ReadWriteNBTCompoundList;
|
import de.tr7zw.changeme.nbtapi.iface.ReadWriteNBTCompoundList;
|
||||||
import de.tr7zw.changeme.nbtapi.iface.ReadWriteNBTList;
|
import de.tr7zw.changeme.nbtapi.iface.ReadWriteNBTList;
|
||||||
|
@@ -42,11 +42,7 @@ tasks {
|
|||||||
shadowJar {
|
shadowJar {
|
||||||
dependsOn(":core-relocate-lettuce:shadowJar")
|
dependsOn(":core-relocate-lettuce:shadowJar")
|
||||||
val task = project(":core-relocate-lettuce").tasks.shadowJar.get()
|
val task = project(":core-relocate-lettuce").tasks.shadowJar.get()
|
||||||
from(task.outputs.files.map {
|
from(task.outputs.files.map { if (it.isDirectory) it else zipTree(it) })
|
||||||
if (it.isDirectory) it else zipTree(
|
|
||||||
it
|
|
||||||
)
|
|
||||||
})
|
|
||||||
destinationDirectory = rootProject.layout.buildDirectory
|
destinationDirectory = rootProject.layout.buildDirectory
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -70,6 +70,8 @@ public class HamsterCorePlugin extends Plugin {
|
|||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
|
audienceProvider.close();
|
||||||
|
simpleLogger.info("已关闭 AudienceProvider.");
|
||||||
if (CoreAPI.getInstance().isEnableRedis()) {
|
if (CoreAPI.getInstance().isEnableRedis()) {
|
||||||
CoreAPI.getInstance().getJedisPool().close();
|
CoreAPI.getInstance().getJedisPool().close();
|
||||||
CoreAPI.getInstance().getRedisClient().close();
|
CoreAPI.getInstance().getRedisClient().close();
|
||||||
|
@@ -47,7 +47,7 @@ public final class UpdateCheckUtils {
|
|||||||
case "GITEA_RELEASES": {
|
case "GITEA_RELEASES": {
|
||||||
lastRelease = getGiteaLastRelease(baseUrl, gitRepo, gitToken);
|
lastRelease = getGiteaLastRelease(baseUrl, gitRepo, gitToken);
|
||||||
if (downloadUrl == null) {
|
if (downloadUrl == null) {
|
||||||
downloadUrl = URI.create(baseUrl).resolve(gitRepo).toString();
|
downloadUrl = URI.create(baseUrl).resolve("/" + gitRepo).toString();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -58,7 +58,7 @@ public final class UpdateCheckUtils {
|
|||||||
}
|
}
|
||||||
lastRelease = getGitlabLastRelease(baseUrl, projectID, gitToken);
|
lastRelease = getGitlabLastRelease(baseUrl, projectID, gitToken);
|
||||||
if (downloadUrl == null) {
|
if (downloadUrl == null) {
|
||||||
downloadUrl = URI.create(baseUrl).resolve(gitRepo).toString();
|
downloadUrl = URI.create(baseUrl).resolve("/" + gitRepo).toString();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,9 @@
|
|||||||
@file:Suppress("VulnerableLibrariesLocal")
|
@file:Suppress("VulnerableLibrariesLocal")
|
||||||
|
|
||||||
evaluationDependsOn(":core-common")
|
evaluationDependsOn(":core-common")
|
||||||
|
evaluationDependsOn(":core-relocate-lettuce")
|
||||||
|
|
||||||
|
val shade = configurations.create("shade")
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api(project(":core-common")) { isTransitive = false }
|
api(project(":core-common")) { isTransitive = false }
|
||||||
@@ -14,10 +17,11 @@ dependencies {
|
|||||||
exclude(group = "com.google.code.gson")
|
exclude(group = "com.google.code.gson")
|
||||||
exclude(group = "org.slf4j")
|
exclude(group = "org.slf4j")
|
||||||
}
|
}
|
||||||
api("io.lettuce:lettuce-core:6.7.1.RELEASE") {
|
compileOnlyApi("io.lettuce:lettuce-core:6.7.1.RELEASE") {
|
||||||
exclude(group = "io.netty")
|
|
||||||
exclude(group = "org.slf4j")
|
exclude(group = "org.slf4j")
|
||||||
|
exclude(group = "io.netty")
|
||||||
}
|
}
|
||||||
|
shade(project(":core-relocate-lettuce"))
|
||||||
|
|
||||||
// https://mvnrepository.com/artifact/com.mysql/mysql-connector-j
|
// https://mvnrepository.com/artifact/com.mysql/mysql-connector-j
|
||||||
runtimeOnly("com.mysql:mysql-connector-j:8.4.0")
|
runtimeOnly("com.mysql:mysql-connector-j:8.4.0")
|
||||||
@@ -50,6 +54,9 @@ tasks {
|
|||||||
archiveBaseName = "HamsterCore-Velocity"
|
archiveBaseName = "HamsterCore-Velocity"
|
||||||
}
|
}
|
||||||
shadowJar {
|
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
|
destinationDirectory = rootProject.layout.buildDirectory
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -4,6 +4,7 @@ import cn.hamster3.mc.plugin.core.common.api.CoreAPI;
|
|||||||
import cn.hamster3.mc.plugin.core.common.config.YamlConfig;
|
import cn.hamster3.mc.plugin.core.common.config.YamlConfig;
|
||||||
import cn.hamster3.mc.plugin.core.common.util.UpdateCheckUtils;
|
import cn.hamster3.mc.plugin.core.common.util.UpdateCheckUtils;
|
||||||
import cn.hamster3.mc.plugin.core.velocity.api.CoreVelocityAPI;
|
import cn.hamster3.mc.plugin.core.velocity.api.CoreVelocityAPI;
|
||||||
|
import cn.hamster3.mc.plugin.core.velocity.impl.AudienceProviderImpl;
|
||||||
import cn.hamster3.mc.plugin.core.velocity.util.VelocitySimpleLogger;
|
import cn.hamster3.mc.plugin.core.velocity.util.VelocitySimpleLogger;
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import com.velocitypowered.api.event.PostOrder;
|
import com.velocitypowered.api.event.PostOrder;
|
||||||
@@ -83,6 +84,8 @@ public class HamsterCorePlugin {
|
|||||||
@Subscribe(order = PostOrder.LAST)
|
@Subscribe(order = PostOrder.LAST)
|
||||||
public void onProxyShutdown(ProxyShutdownEvent event) {
|
public void onProxyShutdown(ProxyShutdownEvent event) {
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
|
AudienceProviderImpl.INSTANCE.close();
|
||||||
|
simpleLogger.info("已关闭 AudienceProvider.");
|
||||||
if (CoreAPI.getInstance().isEnableRedis()) {
|
if (CoreAPI.getInstance().isEnableRedis()) {
|
||||||
CoreAPI.getInstance().getJedisPool().close();
|
CoreAPI.getInstance().getJedisPool().close();
|
||||||
CoreAPI.getInstance().getRedisClient().close();
|
CoreAPI.getInstance().getRedisClient().close();
|
||||||
|
Reference in New Issue
Block a user