summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--CHANGELOG.md19
-rw-r--r--build.gradle.kts2
-rw-r--r--platform-paper/build.gradle.kts8
-rw-r--r--platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/BuildInfo.kt4
-rw-r--r--platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lc/StatusCommand.kt15
-rw-r--r--platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lcv/VelocityStatusCommand.kt9
-rw-r--r--platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/listener/PlayerChatListener.kt2
-rw-r--r--platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/listener/PlayerPresenceListener.kt18
-rw-r--r--platform-paper/src/main/resources/build-info.properties1
-rw-r--r--platform-paper/src/main/resources/languages/en.yml9
-rw-r--r--platform-paper/src/main/resources/languages/ja.yml9
-rw-r--r--platform-velocity/build.gradle.kts20
-rw-r--r--platform-velocity/src/main/kotlin/dev/m1sk9/lunaticChat/velocity/BuildInfo.kt23
-rw-r--r--platform-velocity/src/main/resources/build-info.properties3
-rwxr-xr-xx234
16 files changed, 267 insertions, 110 deletions
diff --git a/.gitignore b/.gitignore
index 729de3c..dc37cdd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,3 +23,4 @@ gradle-app.setting
.idea/
docs/.vitepress/cache/deps
+/docker/paper/plugins
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ec0507c..a59c865 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,14 +2,23 @@
## v1
-### v1.0.0 (Unreleased)
+### v1.0.0
-#### Features
+#### Announcement: Support for Nightly Releases
-- Paper 26.1 (Minecraft 26.1) is now supported.
- - Support for Paper 1.21.X, Folia 1.21.X (and later) has been dropped.
+- We have started distributing Nightly releases
+ - Whenever updates are made to `main` (the default branch), we will distribute the current build via GitHub Releases
+ - Since the Nightly version is a work-in-progress, it may be unstable or contain bugs. If you encounter any issues, please report them on GitHub Issues
+
+> [!WARNING]
+>
+> The Nightly version is not available on Modrinth
-## v0
+#### New Features
+
+- Paper 26.1 (Minecraft 26.1) is now supported.
+ - Support for Paper 1.21.X, Folia 1.21.X (and later) has been dropped.
+- We have added warnings when running `/lc status` or `/lcv status`, or when logging in, if you are using the Nightly version.
### v0.11.0
diff --git a/build.gradle.kts b/build.gradle.kts
index 9bda715..ee27d45 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -14,7 +14,7 @@ plugins {
allprojects {
group = "dev.m1sk9"
- version = "0.11.0"
+ version = findProperty("version")?.toString()?.takeIf { it != "unspecified" } ?: "1.0.0"
repositories {
mavenCentral()
diff --git a/platform-paper/build.gradle.kts b/platform-paper/build.gradle.kts
index 0647a1d..b6d452e 100644
--- a/platform-paper/build.gradle.kts
+++ b/platform-paper/build.gradle.kts
@@ -51,7 +51,13 @@ tasks {
.get()
.trim()
- val props = mapOf("version" to project.version, "gitCommitHash" to gitCommitHash)
+ val isNightly = providers.gradleProperty("isNightly").orNull?.toBoolean() ?: false
+ val props =
+ mapOf(
+ "version" to project.version,
+ "gitCommitHash" to gitCommitHash,
+ "channel" to if (isNightly) "nightly" else "stable",
+ )
inputs.properties(props)
filteringCharset = "UTF-8"
filesMatching("paper-plugin.yml") {
diff --git a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/BuildInfo.kt b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/BuildInfo.kt
index 5609fe9..bac9107 100644
--- a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/BuildInfo.kt
+++ b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/BuildInfo.kt
@@ -5,6 +5,7 @@ import java.util.Properties
object BuildInfo {
val version: String
val commitHash: String
+ val channel: String
init {
val props = Properties()
@@ -13,7 +14,10 @@ object BuildInfo {
}
version = props.getProperty("version", "unknown")
commitHash = props.getProperty("commit", "unknown")
+ channel = props.getProperty("channel", "stable")
}
+ val isNightly: Boolean get() = channel == "nightly"
+
fun versionWithCommit(): String = "$version ($commitHash)"
}
diff --git a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lc/StatusCommand.kt b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lc/StatusCommand.kt
index 82dcd9f..3a4149c 100644
--- a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lc/StatusCommand.kt
+++ b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lc/StatusCommand.kt
@@ -101,6 +101,13 @@ class StatusCommand(
sender.apply {
sendMessage(versionLine)
+
+ // Nightly warning
+ if (BuildInfo.isNightly) {
+ sendMessage(MessageFormatter.format(languageManager.getMessage("general.nightlyWarning"))
+ .color(NamedTextColor.YELLOW))
+ }
+
sendMessage(healthLine)
// --- Features ---
@@ -121,6 +128,14 @@ class StatusCommand(
)
sendMessage(getToggleLine(languageManager.getMessage("status.config.debug"), configuration.debug))
sendMessage(getToggleLine(languageManager.getMessage("status.config.checkForUpdates"), configuration.checkForUpdates))
+ val channelLabel = languageManager.getMessage("status.channel.${BuildInfo.channel}")
+ val channelColor = if (BuildInfo.isNightly) NamedTextColor.YELLOW else NamedTextColor.GREEN
+ sendMessage(
+ Component
+ .text(" • ", NamedTextColor.GRAY)
+ .append(Component.text("${languageManager.getMessage("status.releaseChannel")}: ", NamedTextColor.GRAY))
+ .append(Component.text(channelLabel, channelColor)),
+ )
sendMessage(
Component
.text(" • ", NamedTextColor.GRAY)
diff --git a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lcv/VelocityStatusCommand.kt b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lcv/VelocityStatusCommand.kt
index 6ebb4f4..9e926fc 100644
--- a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lcv/VelocityStatusCommand.kt
+++ b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lcv/VelocityStatusCommand.kt
@@ -4,6 +4,7 @@ import com.mojang.brigadier.builder.LiteralArgumentBuilder
import dev.m1sk9.lunaticChat.engine.command.CommandResult
import dev.m1sk9.lunaticChat.engine.permission.LunaticChatPermissionNode
import dev.m1sk9.lunaticChat.engine.protocol.ProtocolVersion
+import dev.m1sk9.lunaticChat.paper.BuildInfo
import dev.m1sk9.lunaticChat.paper.LunaticChat
import dev.m1sk9.lunaticChat.paper.command.annotation.Command
import dev.m1sk9.lunaticChat.paper.command.annotation.Permission
@@ -15,6 +16,7 @@ import dev.m1sk9.lunaticChat.paper.velocity.VelocityConnectionManager
import io.papermc.paper.command.brigadier.CommandSourceStack
import io.papermc.paper.command.brigadier.Commands
import net.kyori.adventure.text.Component
+import net.kyori.adventure.text.event.ClickEvent
import net.kyori.adventure.text.event.HoverEvent
import net.kyori.adventure.text.format.NamedTextColor
@@ -138,6 +140,13 @@ class VelocityStatusCommand(
languageManager.getMessage("velocity.status.header"),
),
)
+
+ // Nightly warning
+ if (BuildInfo.isNightly) {
+ sendMessage(MessageFormatter.format(languageManager.getMessage("general.nightlyWarning"))
+ .color(NamedTextColor.YELLOW))
+ }
+
// Connection status details
connectionStatus.forEach { line ->
line?.let { sendMessage(it) }
diff --git a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/listener/PlayerChatListener.kt b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/listener/PlayerChatListener.kt
index 19b284b..3bd2d4a 100644
--- a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/listener/PlayerChatListener.kt
+++ b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/listener/PlayerChatListener.kt
@@ -85,7 +85,7 @@ class PlayerChatListener(
when {
hasActiveChannel && !hasPrefix -> {
// Channel chat: player is in a channel and no '!' prefix
- if (channelManager != null && channelMessageHandler != null) {
+ if (channelMessageHandler != null) {
event.isCancelled = true
event.viewers().clear()
event.message(Component.empty())
diff --git a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/listener/PlayerPresenceListener.kt b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/listener/PlayerPresenceListener.kt
index 56cbe59..86a8519 100644
--- a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/listener/PlayerPresenceListener.kt
+++ b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/listener/PlayerPresenceListener.kt
@@ -1,13 +1,16 @@
package dev.m1sk9.lunaticChat.paper.listener
import dev.m1sk9.lunaticChat.engine.permission.LunaticChatPermissionNode
+import dev.m1sk9.lunaticChat.paper.BuildInfo
import dev.m1sk9.lunaticChat.paper.LunaticChat
import dev.m1sk9.lunaticChat.paper.chat.channel.ChannelManager
import dev.m1sk9.lunaticChat.paper.common.hasAnyPermission
import dev.m1sk9.lunaticChat.paper.i18n.LanguageManager
import dev.m1sk9.lunaticChat.paper.i18n.MessageFormatter
import dev.m1sk9.lunaticChat.paper.settings.PlayerSettingsManager
+import net.kyori.adventure.text.Component
import net.kyori.adventure.text.event.ClickEvent
+import net.kyori.adventure.text.format.NamedTextColor
import org.bukkit.event.EventHandler
import org.bukkit.event.Listener
import org.bukkit.event.player.PlayerJoinEvent
@@ -39,6 +42,21 @@ class PlayerPresenceListener(
}, 3, TimeUnit.SECONDS)
}
+ // Nightly build warning
+ if (BuildInfo.isNightly) {
+ lunaticChat.server.asyncScheduler.runDelayed(lunaticChat, { _ ->
+ if (player.isOnline) {
+ player.sendMessage(MessageFormatter.format(languageManager.getMessage("general.nightlyWarning"))
+ .color(NamedTextColor.YELLOW))
+ player.sendMessage(
+ MessageFormatter.format(languageManager.getMessage("general.nightlyReportIssue"))
+ .clickEvent(ClickEvent.openUrl("https://github.com/m1sk9/LunaticChat/issues"))
+ .color(NamedTextColor.YELLOW)
+ )
+ }
+ }, 6, TimeUnit.SECONDS)
+ }
+
// Restore active channel from membership and notify (delayed to avoid being buried by other plugins' join messages)
channelManager?.let { manager ->
val context = manager.restorePlayerChannel(player.uniqueId)
diff --git a/platform-paper/src/main/resources/build-info.properties b/platform-paper/src/main/resources/build-info.properties
index f093468..1f8dbc2 100644
--- a/platform-paper/src/main/resources/build-info.properties
+++ b/platform-paper/src/main/resources/build-info.properties
@@ -1,2 +1,3 @@
version=${version}
commit=${gitCommitHash}
+channel=${channel}
diff --git a/platform-paper/src/main/resources/languages/en.yml b/platform-paper/src/main/resources/languages/en.yml
index 04ca56a..4f3be82 100644
--- a/platform-paper/src/main/resources/languages/en.yml
+++ b/platform-paper/src/main/resources/languages/en.yml
@@ -56,6 +56,13 @@ status:
ok: "OK"
degraded: "Degraded"
degradedHover: "Velocity integration is enabled but the connection failed. Use /lcv status for details."
+ nightlyWarning: "WARNING: This is a nightly build and may be unstable. Do not use in production."
+ nightlyHover: "Nightly builds are automatically generated from the latest code and have not been tested for stability."
+ nightlyReportIssue: "If you encounter any issues, please report them on GitHub Issues."
+ releaseChannel: "Release Channel"
+ channel:
+ stable: "Stable"
+ nightly: "Nightly"
settings:
availableValues: "Available settings value: {values}"
@@ -200,6 +207,8 @@ general:
newUpdateAvailable: "The new version of LunaticChat is now available! You can download it from GitHub or Modrinth."
noPermission: "You do not have permission to execute this command."
spyMessage: "You have been granted permission, so this message is displayed in spy mode."
+ nightlyWarning: "You are running a nightly build of LunaticChat. This build may be unstable or contain bugs."
+ nightlyReportIssue: "If you encounter any issues, please report them on GitHub Issues."
toggle:
off: "Disabled"
diff --git a/platform-paper/src/main/resources/languages/ja.yml b/platform-paper/src/main/resources/languages/ja.yml
index 74f2dfb..327144e 100644
--- a/platform-paper/src/main/resources/languages/ja.yml
+++ b/platform-paper/src/main/resources/languages/ja.yml
@@ -56,6 +56,13 @@ status:
ok: "正常"
degraded: "問題あり"
degradedHover: "Velocity 連携が有効ですが接続に失敗しました。/lcv status を確認してください。"
+ nightlyWarning: "警告: これはナイトリービルドです。不安定な可能性があるため、本番環境では使用しないでください。"
+ nightlyHover: "ナイトリービルドは最新のコードから自動生成されており、安定性のテストは行われていません。"
+ nightlyReportIssue: "問題を発見した場合は、GitHub Issues で報告してください。"
+ releaseChannel: "リリースチャンネル"
+ channel:
+ stable: "安定版"
+ nightly: "ナイトリー"
settings:
availableValues: "使用可能な設定値: {values}"
@@ -200,6 +207,8 @@ general:
newUpdateAvailable: "LunaticChat の新しいバージョンが利用可能です。GitHubまたはModrinthからダウンロードできます"
noPermission: "このコマンドを実行する権限がありません"
spyMessage: "あなたに権限が付与されているため、このメッセージはスパイ状態で表示されています"
+ nightlyWarning: "LunaticChat のナイトリービルドを使用しています。このビルドは不安定であったり、バグが含まれている可能性があります。"
+ nightlyReportIssue: "問題を発見した場合は、GitHub Issues で報告してください。"
toggle:
on: "有効"
diff --git a/platform-velocity/build.gradle.kts b/platform-velocity/build.gradle.kts
index cc8af58..f6a4e57 100644
--- a/platform-velocity/build.gradle.kts
+++ b/platform-velocity/build.gradle.kts
@@ -36,12 +36,30 @@ tasks {
}
processResources {
- val props = mapOf("version" to project.version)
+ val gitCommitHash =
+ providers
+ .exec {
+ commandLine("git", "rev-parse", "--short", "HEAD")
+ }.standardOutput
+ .asText
+ .get()
+ .trim()
+
+ val isNightly = providers.gradleProperty("isNightly").orNull?.toBoolean() ?: false
+ val props =
+ mapOf(
+ "version" to project.version,
+ "gitCommitHash" to gitCommitHash,
+ "channel" to if (isNightly) "nightly" else "stable",
+ )
inputs.properties(props)
filteringCharset = "UTF-8"
filesMatching("velocity-plugin.json") {
expand(props)
}
+ filesMatching("build-info.properties") {
+ expand(props)
+ }
}
build {
diff --git a/platform-velocity/src/main/kotlin/dev/m1sk9/lunaticChat/velocity/BuildInfo.kt b/platform-velocity/src/main/kotlin/dev/m1sk9/lunaticChat/velocity/BuildInfo.kt
new file mode 100644
index 0000000..1cb13d4
--- /dev/null
+++ b/platform-velocity/src/main/kotlin/dev/m1sk9/lunaticChat/velocity/BuildInfo.kt
@@ -0,0 +1,23 @@
+package dev.m1sk9.lunaticChat.velocity
+
+import java.util.Properties
+
+object BuildInfo {
+ val version: String
+ val commitHash: String
+ val channel: String
+
+ init {
+ val props = Properties()
+ BuildInfo::class.java.getResourceAsStream("/build-info.properties")?.use {
+ props.load(it)
+ }
+ version = props.getProperty("version", "unknown")
+ commitHash = props.getProperty("commit", "unknown")
+ channel = props.getProperty("channel", "stable")
+ }
+
+ val isNightly: Boolean get() = channel == "nightly"
+
+ fun versionWithCommit(): String = "$version ($commitHash)"
+}
diff --git a/platform-velocity/src/main/resources/build-info.properties b/platform-velocity/src/main/resources/build-info.properties
new file mode 100644
index 0000000..1f8dbc2
--- /dev/null
+++ b/platform-velocity/src/main/resources/build-info.properties
@@ -0,0 +1,3 @@
+version=${version}
+commit=${gitCommitHash}
+channel=${channel}
diff --git a/x b/x
index a52964c..aa9a210 100755
--- a/x
+++ b/x
@@ -2,70 +2,107 @@
set -e
+DC_PAPER="docker compose -f docker/paper/compose.yaml"
DC_VELOCITY="docker compose -f docker/velocity/compose.yaml"
DC_FOLIA="docker compose -f docker/folia/compose.yaml"
+GRADLE_EXTRA_ARGS=""
+
help() {
cat <<EOF
-Usage: ./x <command> [options]
-
-Velocity environment (Paper s1 + s2 + Velocity proxy):
- start Build Paper+Velocity and start all containers
- start-s1 Build Paper and start only s1 container
- restart Restart s1, s2 and velocity containers
- stop Stop velocity environment
- clean Stop velocity environment and remove volumes
- rcon [server] Open rcon-cli for server container (default: s1)
- Available servers: s1, s2
- logs [server] Show server container logs (default: s1)
- Available servers: s1, s2
- vlogs Show velocity proxy container logs
-
-Folia environment (single Folia server):
- folia start Build Paper and start Folia server
- folia restart Restart Folia server
- folia stop Stop Folia server
- folia clean Stop Folia server and remove volumes
- folia rcon Open rcon-cli for Folia server
- folia logs Show Folia server logs
-
-General:
- help Show this help message
+Usage: ./x <action> <platform> [--stable]
+
+Actions:
+ start Build and start containers
+ stop Stop containers
+ log Show container logs
+ clean Stop containers and remove volumes
+ rcon Open rcon-cli console (velocity: ./x rcon velocity [s1|s2])
+ help Show this help message
+
+Platforms:
+ paper Single Paper server (localhost:25565)
+ velocity Velocity proxy + Paper s1 & s2 (localhost:25577)
+ folia Single Folia server (localhost:25565)
+
+Options:
+ --stable Build as stable release (default: nightly)
+
+Examples:
+ ./x start paper Build nightly and start Paper server
+ ./x start velocity Build nightly and start Velocity environment
+ ./x start folia Build nightly and start Folia server
+ ./x start paper --stable Build stable and start Paper server
+ ./x log velocity Show Velocity environment logs
+ ./x rcon paper Open rcon-cli for Paper server
+ ./x stop velocity Stop Velocity environment
+ ./x clean folia Stop Folia and remove volumes
EOF
}
+setup_nightly() {
+ SHORT_HASH=$(git rev-parse --short HEAD)
+ GRADLE_EXTRA_ARGS="-Pversion=1.0.0-nightly.${SHORT_HASH} -PisNightly=true"
+ echo "==> Nightly build: 1.0.0-nightly.${SHORT_HASH}"
+}
+
ensure_plugin_dir() {
mkdir -p "$1"
}
-# --- Folia commands ---
-folia_cmd() {
- case "${1:-}" in
- start)
- ./gradlew :platform-paper:clean :platform-paper:shadowJar
+# Parse --stable flag (only setup build for actions that need it)
+ACTION="${1:-}"
+PLATFORM="${2:-}"
+
+if [[ "$ACTION" == "start" ]]; then
+ STABLE=false
+ for arg in "$@"; do
+ if [[ "$arg" == "--stable" ]]; then
+ STABLE=true
+ fi
+ done
+
+ if [[ "$STABLE" == "false" ]]; then
+ setup_nightly
+ else
+ echo "==> Stable build"
+ fi
+fi
+
+# --- Actions per platform ---
+
+do_start() {
+ case "$1" in
+ paper)
+ ./gradlew :platform-paper:clean :platform-paper:shadowJar $GRADLE_EXTRA_ARGS
+ ensure_plugin_dir docker/paper/plugins
+ rm -f docker/paper/plugins/*.jar
+ cp platform-paper/build/libs/*.jar docker/paper/plugins/
+ $DC_PAPER up
+ ;;
+ velocity)
+ ./gradlew :platform-paper:clean :platform-paper:shadowJar :platform-velocity:clean :platform-velocity:shadowJar $GRADLE_EXTRA_ARGS
+ ensure_plugin_dir docker/velocity/plugins-paper-s1
+ ensure_plugin_dir docker/velocity/plugins-paper-s2
+ ensure_plugin_dir docker/velocity/plugins-velocity
+ rm -f docker/velocity/plugins-paper-s1/*.jar
+ rm -f docker/velocity/plugins-paper-s2/*.jar
+ rm -f docker/velocity/plugins-velocity/*.jar
+ cp platform-paper/build/libs/*.jar docker/velocity/plugins-paper-s1/
+ cp platform-paper/build/libs/*.jar docker/velocity/plugins-paper-s2/
+ cp platform-velocity/build/libs/*.jar docker/velocity/plugins-velocity/
+ $DC_VELOCITY up
+ ;;
+ folia)
+ ./gradlew :platform-paper:clean :platform-paper:shadowJar $GRADLE_EXTRA_ARGS
ensure_plugin_dir docker/folia/plugins
rm -f docker/folia/plugins/*.jar
cp platform-paper/build/libs/*.jar docker/folia/plugins/
$DC_FOLIA up
;;
- restart)
- $DC_FOLIA restart folia
- ;;
- stop)
- $DC_FOLIA down
- ;;
- clean)
- $DC_FOLIA down -v
- ;;
- rcon)
- $DC_FOLIA exec folia rcon-cli
- ;;
- logs)
- $DC_FOLIA logs -f folia
- ;;
*)
- echo "Unknown folia command: ${1:-}"
+ echo "Unknown platform: ${1:-}"
echo ""
help
exit 1
@@ -73,64 +110,59 @@ folia_cmd() {
esac
}
+do_stop() {
+ case "$1" in
+ paper) $DC_PAPER down ;;
+ velocity) $DC_VELOCITY down ;;
+ folia) $DC_FOLIA down ;;
+ *) echo "Unknown platform: ${1:-}"; exit 1 ;;
+ esac
+}
+
+do_log() {
+ case "$1" in
+ paper) $DC_PAPER logs -f paper ;;
+ velocity) $DC_VELOCITY logs -f ;;
+ folia) $DC_FOLIA logs -f folia ;;
+ *) echo "Unknown platform: ${1:-}"; exit 1 ;;
+ esac
+}
+
+do_clean() {
+ case "$1" in
+ paper) $DC_PAPER down -v ;;
+ velocity) $DC_VELOCITY down -v ;;
+ folia) $DC_FOLIA down -v ;;
+ *) echo "Unknown platform: ${1:-}"; exit 1 ;;
+ esac
+}
+
+do_rcon() {
+ case "$1" in
+ paper) $DC_PAPER exec paper rcon-cli ;;
+ velocity)
+ local server="${2:-s1}"
+ if [[ "$server" != "s1" && "$server" != "s2" ]]; then
+ echo "Error: Invalid server '$server'. Available: s1, s2"
+ exit 1
+ fi
+ $DC_VELOCITY exec "$server" rcon-cli
+ ;;
+ folia) $DC_FOLIA exec folia rcon-cli ;;
+ *) echo "Unknown platform: ${1:-}"; exit 1 ;;
+ esac
+}
+
# --- Main ---
-case "${1:-}" in
- folia)
- folia_cmd "${2:-}"
- ;;
- start)
- ./gradlew :platform-paper:clean :platform-paper:shadowJar :platform-velocity:clean :platform-velocity:shadowJar
- ensure_plugin_dir docker/velocity/plugins-paper-s1
- ensure_plugin_dir docker/velocity/plugins-paper-s2
- ensure_plugin_dir docker/velocity/plugins-velocity
- rm -f docker/velocity/plugins-paper-s1/*.jar
- rm -f docker/velocity/plugins-paper-s2/*.jar
- rm -f docker/velocity/plugins-velocity/*.jar
- cp platform-paper/build/libs/*.jar docker/velocity/plugins-paper-s1/
- cp platform-paper/build/libs/*.jar docker/velocity/plugins-paper-s2/
- cp platform-velocity/build/libs/*.jar docker/velocity/plugins-velocity/
- $DC_VELOCITY up
- ;;
- start-s1)
- ./gradlew :platform-paper:clean :platform-paper:shadowJar
- ensure_plugin_dir docker/velocity/plugins-paper-s1
- rm -f docker/velocity/plugins-paper-s1/*.jar
- cp platform-paper/build/libs/*.jar docker/velocity/plugins-paper-s1/
- $DC_VELOCITY up s1
- ;;
- restart)
- $DC_VELOCITY restart s1 s2 velocity
- ;;
- stop)
- $DC_VELOCITY down
- ;;
- clean)
- $DC_VELOCITY down -v
- ;;
- rcon)
- SERVER="${2:-s1}"
- if [[ "$SERVER" != "s1" && "$SERVER" != "s2" ]]; then
- echo "Error: Invalid server '$SERVER'. Available servers: s1, s2"
- exit 1
- fi
- $DC_VELOCITY exec "$SERVER" rcon-cli
- ;;
- logs)
- SERVER="${2:-s1}"
- if [[ "$SERVER" != "s1" && "$SERVER" != "s2" ]]; then
- echo "Error: Invalid server '$SERVER'. Available servers: s1, s2"
- exit 1
- fi
- $DC_VELOCITY logs -f "$SERVER"
- ;;
- vlogs)
- $DC_VELOCITY logs -f velocity
- ;;
- help|"")
- help
- ;;
+case "$ACTION" in
+ start) do_start "$PLATFORM" ;;
+ stop) do_stop "$PLATFORM" ;;
+ log) do_log "$PLATFORM" ;;
+ clean) do_clean "$PLATFORM" ;;
+ rcon) do_rcon "$PLATFORM" "${3:-}" ;;
+ help|"") help ;;
*)
- echo "Unknown command: $1"
+ echo "Unknown action: $ACTION"
echo ""
help
exit 1