2 Commits

Author SHA1 Message Date
95c0a23857 build: 优化构建脚本 2025-03-23 00:46:54 +08:00
00dbcba628 fix(ball-common): 提前对服务器 id 和 name 进行空判断 2025-01-26 15:01:15 +08:00
4 changed files with 17 additions and 5 deletions

View File

@@ -20,6 +20,6 @@ tasks {
archiveBaseName = "HamsterBall-Bukkit" archiveBaseName = "HamsterBall-Bukkit"
} }
shadowJar { shadowJar {
destinationDirectory = rootProject.buildDir destinationDirectory = rootProject.layout.buildDirectory
} }
} }

View File

@@ -18,6 +18,6 @@ tasks {
archiveBaseName = "HamsterBall-BungeeCord" archiveBaseName = "HamsterBall-BungeeCord"
} }
shadowJar { shadowJar {
destinationDirectory = rootProject.buildDir destinationDirectory = rootProject.layout.buildDirectory
} }
} }

View File

@@ -46,7 +46,13 @@ public class BallServerInfo {
public BallServerInfo(@NotNull ConfigSection config, @NotNull BallServerType type) { public BallServerInfo(@NotNull ConfigSection config, @NotNull BallServerType type) {
Map<String, String> env = System.getenv(); Map<String, String> env = System.getenv();
id = env.getOrDefault("BALL_SERVER_ID", config.getString("id")); id = env.getOrDefault("BALL_SERVER_ID", config.getString("id"));
if (id == null || id.isEmpty()) {
throw new IllegalArgumentException("id 不能为空");
}
name = env.getOrDefault("BALL_SERVER_NAME", config.getString("name")); name = env.getOrDefault("BALL_SERVER_NAME", config.getString("name"));
if (name == null || name.isEmpty()) {
throw new IllegalArgumentException("name 不能为空");
}
this.type = type; this.type = type;
host = "0.0.0.0"; host = "0.0.0.0";
port = 0; port = 0;

View File

@@ -1,18 +1,24 @@
buildscript {
repositories {
maven("https://maven.airgame.net/maven-public/")
}
}
plugins { plugins {
id("java-library") id("java-library")
id("maven-publish") id("maven-publish")
id("com.github.johnrengelman.shadow") version "8+" id("com.gradleup.shadow") version "8.3.6"
} }
group = "cn.hamster3.mc.plugin" group = "cn.hamster3.mc.plugin"
version = "1.7.1" version = "1.7.2"
description = "基于 Redis 的 Minecraft 服务端通用消息中间件" description = "基于 Redis 的 Minecraft 服务端通用消息中间件"
subprojects { subprojects {
apply { apply {
plugin("java-library") plugin("java-library")
plugin("maven-publish") plugin("maven-publish")
plugin("com.github.johnrengelman.shadow") plugin("com.gradleup.shadow")
} }
group = rootProject.group group = rootProject.group