From 1265f5d6051fbf7942be2a913870bdd1bd5f24fe Mon Sep 17 00:00:00 2001 From: Sho Sakuma Date: Mon, 23 Feb 2026 16:42:38 +0900 Subject: chore: Support folia debug-server --- docker/.gitignore | 2 - docker/bukkit.yml | 43 ------------- docker/compose.yaml | 130 --------------------------------------- docker/folia/.gitignore | 1 + docker/folia/bukkit.yml | 43 +++++++++++++ docker/folia/compose.yaml | 47 ++++++++++++++ docker/paper-global.yml | 8 --- docker/velocity.toml | 124 ------------------------------------- docker/velocity/.gitignore | 2 + docker/velocity/bukkit.yml | 43 +++++++++++++ docker/velocity/compose.yaml | 130 +++++++++++++++++++++++++++++++++++++++ docker/velocity/paper-global.yml | 8 +++ docker/velocity/velocity.toml | 124 +++++++++++++++++++++++++++++++++++++ x | 94 ++++++++++++++++++++++------ 14 files changed, 472 insertions(+), 327 deletions(-) delete mode 100644 docker/.gitignore delete mode 100644 docker/bukkit.yml delete mode 100644 docker/compose.yaml create mode 100644 docker/folia/.gitignore create mode 100644 docker/folia/bukkit.yml create mode 100644 docker/folia/compose.yaml delete mode 100644 docker/paper-global.yml delete mode 100644 docker/velocity.toml create mode 100644 docker/velocity/.gitignore create mode 100644 docker/velocity/bukkit.yml create mode 100644 docker/velocity/compose.yaml create mode 100644 docker/velocity/paper-global.yml create mode 100644 docker/velocity/velocity.toml diff --git a/docker/.gitignore b/docker/.gitignore deleted file mode 100644 index 4c0fc30..0000000 --- a/docker/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -plugins-paper-*/ -plugins-velocity/ diff --git a/docker/bukkit.yml b/docker/bukkit.yml deleted file mode 100644 index 2f44ae9..0000000 --- a/docker/bukkit.yml +++ /dev/null @@ -1,43 +0,0 @@ -# This is the Bukkit configuration file in Paper. -# As you can see, there's actually not that much to configure without any plugins. -# -# If you need help with the configuration or have any questions related to Paper, -# join us in our Discord or check the docs page. -# -# File Reference: https://docs.papermc.io/paper/reference/bukkit-configuration/ -# Docs: https://docs.papermc.io/ -# Discord: https://discord.gg/papermc -# Website: https://papermc.io/ - -spawn-limits: - monsters: 70 - animals: 10 - water-animals: 5 - water-ambient: 20 - water-underground-creature: 5 - axolotls: 5 - ambient: 15 -chunk-gc: - period-in-ticks: 600 -ticks-per: - animal-spawns: 400 - monster-spawns: 1 - water-spawns: 1 - water-ambient-spawns: 1 - water-underground-creature-spawns: 1 - axolotl-spawns: 1 - ambient-spawns: 1 - autosave: 6000 -aliases: now-in-commands.yml -settings: - warn-on-overload: true - permissions-file: permissions.yml - update-folder: update - plugin-profiling: false - connection-throttle: 4000 - query-plugins: true - deprecated-verbose: default - shutdown-message: Server closed - minimum-api: none - use-map-color-cache: true - allow-end: false diff --git a/docker/compose.yaml b/docker/compose.yaml deleted file mode 100644 index 2f3d5c9..0000000 --- a/docker/compose.yaml +++ /dev/null @@ -1,130 +0,0 @@ -services: - velocity: - image: itzg/mc-proxy:java21 - container_name: debug-velocity - ports: - - "25577:25577" - volumes: - - lunatic-debug-velocity-data:/server - - ./plugins-velocity:/server/plugins - - ./velocity.toml:/server/velocity.toml - environment: - TYPE: "VELOCITY" - MEMORY: "512M" - ONLINE_MODE: "false" - depends_on: - s1: - condition: service_healthy - s2: - condition: service_healthy - healthcheck: - test: mc-health - start_period: 60s - interval: 10s - timeout: 5s - retries: 3 - networks: - - minecraft-network - - s1: - image: itzg/minecraft-server:java21 - container_name: debug-server-s1 - expose: - - "25565" - ports: - - "25575:25575" - volumes: - - lunatic-debug-s1-data:/data - - ./plugins-paper-s1:/data/plugins - - ./bukkit.yml:/data/bukkit.yml - environment: - EULA: "TRUE" - TYPE: "PAPER" - VERSION: "1.21.11" - MEMORY: "1G" - - # デバッグ用高速化設定 - LEVEL_TYPE: "flat" - VIEW_DISTANCE: "3" - SIMULATION_DISTANCE: "3" - GENERATE_STRUCTURES: "false" - SPAWN_PROTECTION: "0" - ALLOW_NETHER: "false" - - # 権限関連 - OVERRIDE_SERVER_PROPERTIES: "true" - - ENABLE_RCON: "true" - RCON_PASSWORD: "minecraft" - RCON_PORT: 25575 - - DIFFICULTY: "peaceful" - MAX_PLAYERS: "3" - ONLINE_MODE: "false" - SYNC_SKIP_NEWER_IN_DESTINATION: "false" - networks: - - minecraft-network - healthcheck: - test: mc-health - start_period: 60s - interval: 10s - timeout: 5s - retries: 3 - tty: true - stdin_open: true - - s2: - image: itzg/minecraft-server:java21 - container_name: debug-server-s2 - expose: - - "25565" - ports: - - "25576:25575" - volumes: - - lunatic-debug-s2-data:/data - - ./plugins-paper-s2:/data/plugins - - ./bukkit.yml:/data/bukkit.yml - environment: - EULA: "TRUE" - TYPE: "PAPER" - VERSION: "1.21.11" - MEMORY: "1G" - - # デバッグ用高速化設定 - LEVEL_TYPE: "flat" - VIEW_DISTANCE: "3" - SIMULATION_DISTANCE: "3" - GENERATE_STRUCTURES: "false" - SPAWN_PROTECTION: "0" - ALLOW_NETHER: "false" - - # 権限関連 - OVERRIDE_SERVER_PROPERTIES: "true" - - ENABLE_RCON: "true" - RCON_PASSWORD: "minecraft" - RCON_PORT: 25575 - - DIFFICULTY: "peaceful" - MAX_PLAYERS: "3" - ONLINE_MODE: "false" - SYNC_SKIP_NEWER_IN_DESTINATION: "false" - networks: - - minecraft-network - healthcheck: - test: mc-health - start_period: 60s - interval: 10s - timeout: 5s - retries: 3 - tty: true - stdin_open: true - -networks: - minecraft-network: - driver: bridge - -volumes: - lunatic-debug-s1-data: - lunatic-debug-s2-data: - lunatic-debug-velocity-data: diff --git a/docker/folia/.gitignore b/docker/folia/.gitignore new file mode 100644 index 0000000..16873f6 --- /dev/null +++ b/docker/folia/.gitignore @@ -0,0 +1 @@ +plugins/ diff --git a/docker/folia/bukkit.yml b/docker/folia/bukkit.yml new file mode 100644 index 0000000..2f44ae9 --- /dev/null +++ b/docker/folia/bukkit.yml @@ -0,0 +1,43 @@ +# This is the Bukkit configuration file in Paper. +# As you can see, there's actually not that much to configure without any plugins. +# +# If you need help with the configuration or have any questions related to Paper, +# join us in our Discord or check the docs page. +# +# File Reference: https://docs.papermc.io/paper/reference/bukkit-configuration/ +# Docs: https://docs.papermc.io/ +# Discord: https://discord.gg/papermc +# Website: https://papermc.io/ + +spawn-limits: + monsters: 70 + animals: 10 + water-animals: 5 + water-ambient: 20 + water-underground-creature: 5 + axolotls: 5 + ambient: 15 +chunk-gc: + period-in-ticks: 600 +ticks-per: + animal-spawns: 400 + monster-spawns: 1 + water-spawns: 1 + water-ambient-spawns: 1 + water-underground-creature-spawns: 1 + axolotl-spawns: 1 + ambient-spawns: 1 + autosave: 6000 +aliases: now-in-commands.yml +settings: + warn-on-overload: true + permissions-file: permissions.yml + update-folder: update + plugin-profiling: false + connection-throttle: 4000 + query-plugins: true + deprecated-verbose: default + shutdown-message: Server closed + minimum-api: none + use-map-color-cache: true + allow-end: false diff --git a/docker/folia/compose.yaml b/docker/folia/compose.yaml new file mode 100644 index 0000000..dd3f38c --- /dev/null +++ b/docker/folia/compose.yaml @@ -0,0 +1,47 @@ +services: + folia: + image: itzg/minecraft-server:java21 + container_name: debug-folia + ports: + - "25565:25565" + - "25575:25575" + volumes: + - lunatic-debug-folia-data:/data + - ./plugins:/data/plugins + - ./bukkit.yml:/data/bukkit.yml + environment: + EULA: "TRUE" + TYPE: "FOLIA" + VERSION: "1.21.11" + MEMORY: "2G" + + # デバッグ用高速化設定 + LEVEL_TYPE: "flat" + VIEW_DISTANCE: "3" + SIMULATION_DISTANCE: "3" + GENERATE_STRUCTURES: "false" + SPAWN_PROTECTION: "0" + ALLOW_NETHER: "false" + + # 権限関連 + OVERRIDE_SERVER_PROPERTIES: "true" + + ENABLE_RCON: "true" + RCON_PASSWORD: "minecraft" + RCON_PORT: 25575 + + DIFFICULTY: "peaceful" + MAX_PLAYERS: "3" + ONLINE_MODE: "false" + SYNC_SKIP_NEWER_IN_DESTINATION: "false" + healthcheck: + test: mc-health + start_period: 90s + interval: 10s + timeout: 5s + retries: 3 + tty: true + stdin_open: true + +volumes: + lunatic-debug-folia-data: diff --git a/docker/paper-global.yml b/docker/paper-global.yml deleted file mode 100644 index 4c01c4e..0000000 --- a/docker/paper-global.yml +++ /dev/null @@ -1,8 +0,0 @@ -# Paper Global Configuration -# https://docs.papermc.io/paper/reference/global-configuration - -proxies: - velocity: - enabled: true - online-mode: false - secret: "" diff --git a/docker/velocity.toml b/docker/velocity.toml deleted file mode 100644 index 1b5b374..0000000 --- a/docker/velocity.toml +++ /dev/null @@ -1,124 +0,0 @@ -# Config version. Do not change this -config-version = "2.7" - -# What port should the proxy be bound to? By default, we'll bind to all addresses on port 25577. -bind = "0.0.0.0:25577" - -# What should be the MOTD? This gets displayed when the player adds your server to -# their server list. Only MiniMessage format is accepted. -motd = "<#09add3>LunaticChat Debug Server" - -# What should we display for the maximum number of players? (Velocity does not support a cap -# on the number of players online.) -show-max-players = 3 - -# Should we authenticate players with Mojang? By default, this is on. -online-mode = false - -# Should the proxy enforce the new public key security standard? By default, this is on. -force-key-authentication = false - -# If client's ISP/AS sent from this proxy is different from the one from Mojang's -# authentication server, the player is kicked. This disallows some VPN and proxy -# connections but is a weak form of protection. -prevent-client-proxy-connections = false - -# Should we forward IP addresses and other data to backend servers? -# Available options: -# - "none": No forwarding will be done. All players will appear to be connecting -# from the proxy and will have offline-mode UUIDs. -# - "legacy": Forward player IPs and UUIDs in a BungeeCord-compatible format. Use this -# if you run servers using Minecraft 1.12 or lower. -# - "bungeeguard": Forward player IPs and UUIDs in a format supported by the BungeeGuard -# plugin. Use this if you run servers using Minecraft 1.12 or lower, and are -# unable to implement network level firewalling (on a shared host). -# - "modern": Forward player IPs and UUIDs as part of the login process using -# Velocity's native forwarding. Only applicable for Minecraft 1.13 or higher. -player-info-forwarding-mode = "NONE" - -# If you are using modern or BungeeGuard IP forwarding, configure a file that contains a unique secret here. -# The file is expected to be UTF-8 encoded and not empty. -forwarding-secret-file = "forwarding.secret" - -# Announce whether or not your server supports Forge. If you run a modded server, we -# suggest turning this on. -# -# If your network runs one modpack consistently, consider using ping-passthrough = "mods" -# instead for a nicer display in the server list. -announce-forge = false - -[query] -# Should Query be enabled? Query allows clients to request information about the server. -enabled = false - -# This is the map name that is reported to the query services. -map = "Velocity" - -# Whether plugins should be shown in query response by default or not -show-plugins = false - -[servers] -# Configure your servers here. Each key represents the server's name, and the value -# represents the IP address of the server to connect to. -s1 = "s1:25565" -s2 = "s2:25565" - -# In what order we should try servers when a player logs in or is kicked from a server. -try = [ - "s1" -] - -[forced-hosts] -# Configure your forced hosts here. - -[advanced] -# How large a Minecraft packet has to be before we compress it. Setting this to zero will -# compress all packets, and setting it to -1 will disable compression entirely. -compression-threshold = 256 - -# How much compression should be done (from 0-9). The default is -1, which uses the -# default level of 6. -compression-level = -1 - -# How fast (in milliseconds) are clients allowed to connect after the last connection? By -# default, this is three seconds. Disable this by setting this to 0. -login-ratelimit = 3000 - -# Specify a custom timeout for connection timeouts here. The default is five seconds. -connection-timeout = 5000 - -# Specify a read timeout for connections here. The default is 30 seconds. -read-timeout = 30000 - -# Enables compatibility with HAProxy's PROXY protocol. If you don't know what this is for, then -# don't enable it. -haproxy-protocol = false - -# Enables TCP fast open support on the proxy. Requires the proxy to run on Linux. -tcp-fast-open = false - -# Enables BungeeCord plugin messaging channel support on Velocity. -bungee-plugin-message-channel = true - -# Shows ping requests to the proxy from clients. -show-ping-requests = false - -# By default, Velocity will attempt to gracefully handle situations where the user unexpectedly -# loses connection to the server without an explicit disconnect message by attempting to fall the -# user back, except in the case of read timeouts. BungeeCord will disconnect the user instead. You -# can disable this setting to use the BungeeCord behavior. -failover-on-unexpected-server-disconnect = true - -# Declares the proxy commands to 1.13+ clients. -announce-proxy-commands = true - -# Enables the logging of commands -log-command-executions = false - -# Enables logging of player connections when connecting to the proxy, switching servers -# and disconnecting from the proxy. -log-player-connections = true - -# Allows players transferred from other hosts via the -# Transfer packet (Minecraft 1.20.5) to be received. -accepts-transfers = false diff --git a/docker/velocity/.gitignore b/docker/velocity/.gitignore new file mode 100644 index 0000000..4c0fc30 --- /dev/null +++ b/docker/velocity/.gitignore @@ -0,0 +1,2 @@ +plugins-paper-*/ +plugins-velocity/ diff --git a/docker/velocity/bukkit.yml b/docker/velocity/bukkit.yml new file mode 100644 index 0000000..2f44ae9 --- /dev/null +++ b/docker/velocity/bukkit.yml @@ -0,0 +1,43 @@ +# This is the Bukkit configuration file in Paper. +# As you can see, there's actually not that much to configure without any plugins. +# +# If you need help with the configuration or have any questions related to Paper, +# join us in our Discord or check the docs page. +# +# File Reference: https://docs.papermc.io/paper/reference/bukkit-configuration/ +# Docs: https://docs.papermc.io/ +# Discord: https://discord.gg/papermc +# Website: https://papermc.io/ + +spawn-limits: + monsters: 70 + animals: 10 + water-animals: 5 + water-ambient: 20 + water-underground-creature: 5 + axolotls: 5 + ambient: 15 +chunk-gc: + period-in-ticks: 600 +ticks-per: + animal-spawns: 400 + monster-spawns: 1 + water-spawns: 1 + water-ambient-spawns: 1 + water-underground-creature-spawns: 1 + axolotl-spawns: 1 + ambient-spawns: 1 + autosave: 6000 +aliases: now-in-commands.yml +settings: + warn-on-overload: true + permissions-file: permissions.yml + update-folder: update + plugin-profiling: false + connection-throttle: 4000 + query-plugins: true + deprecated-verbose: default + shutdown-message: Server closed + minimum-api: none + use-map-color-cache: true + allow-end: false diff --git a/docker/velocity/compose.yaml b/docker/velocity/compose.yaml new file mode 100644 index 0000000..2f3d5c9 --- /dev/null +++ b/docker/velocity/compose.yaml @@ -0,0 +1,130 @@ +services: + velocity: + image: itzg/mc-proxy:java21 + container_name: debug-velocity + ports: + - "25577:25577" + volumes: + - lunatic-debug-velocity-data:/server + - ./plugins-velocity:/server/plugins + - ./velocity.toml:/server/velocity.toml + environment: + TYPE: "VELOCITY" + MEMORY: "512M" + ONLINE_MODE: "false" + depends_on: + s1: + condition: service_healthy + s2: + condition: service_healthy + healthcheck: + test: mc-health + start_period: 60s + interval: 10s + timeout: 5s + retries: 3 + networks: + - minecraft-network + + s1: + image: itzg/minecraft-server:java21 + container_name: debug-server-s1 + expose: + - "25565" + ports: + - "25575:25575" + volumes: + - lunatic-debug-s1-data:/data + - ./plugins-paper-s1:/data/plugins + - ./bukkit.yml:/data/bukkit.yml + environment: + EULA: "TRUE" + TYPE: "PAPER" + VERSION: "1.21.11" + MEMORY: "1G" + + # デバッグ用高速化設定 + LEVEL_TYPE: "flat" + VIEW_DISTANCE: "3" + SIMULATION_DISTANCE: "3" + GENERATE_STRUCTURES: "false" + SPAWN_PROTECTION: "0" + ALLOW_NETHER: "false" + + # 権限関連 + OVERRIDE_SERVER_PROPERTIES: "true" + + ENABLE_RCON: "true" + RCON_PASSWORD: "minecraft" + RCON_PORT: 25575 + + DIFFICULTY: "peaceful" + MAX_PLAYERS: "3" + ONLINE_MODE: "false" + SYNC_SKIP_NEWER_IN_DESTINATION: "false" + networks: + - minecraft-network + healthcheck: + test: mc-health + start_period: 60s + interval: 10s + timeout: 5s + retries: 3 + tty: true + stdin_open: true + + s2: + image: itzg/minecraft-server:java21 + container_name: debug-server-s2 + expose: + - "25565" + ports: + - "25576:25575" + volumes: + - lunatic-debug-s2-data:/data + - ./plugins-paper-s2:/data/plugins + - ./bukkit.yml:/data/bukkit.yml + environment: + EULA: "TRUE" + TYPE: "PAPER" + VERSION: "1.21.11" + MEMORY: "1G" + + # デバッグ用高速化設定 + LEVEL_TYPE: "flat" + VIEW_DISTANCE: "3" + SIMULATION_DISTANCE: "3" + GENERATE_STRUCTURES: "false" + SPAWN_PROTECTION: "0" + ALLOW_NETHER: "false" + + # 権限関連 + OVERRIDE_SERVER_PROPERTIES: "true" + + ENABLE_RCON: "true" + RCON_PASSWORD: "minecraft" + RCON_PORT: 25575 + + DIFFICULTY: "peaceful" + MAX_PLAYERS: "3" + ONLINE_MODE: "false" + SYNC_SKIP_NEWER_IN_DESTINATION: "false" + networks: + - minecraft-network + healthcheck: + test: mc-health + start_period: 60s + interval: 10s + timeout: 5s + retries: 3 + tty: true + stdin_open: true + +networks: + minecraft-network: + driver: bridge + +volumes: + lunatic-debug-s1-data: + lunatic-debug-s2-data: + lunatic-debug-velocity-data: diff --git a/docker/velocity/paper-global.yml b/docker/velocity/paper-global.yml new file mode 100644 index 0000000..4c01c4e --- /dev/null +++ b/docker/velocity/paper-global.yml @@ -0,0 +1,8 @@ +# Paper Global Configuration +# https://docs.papermc.io/paper/reference/global-configuration + +proxies: + velocity: + enabled: true + online-mode: false + secret: "" diff --git a/docker/velocity/velocity.toml b/docker/velocity/velocity.toml new file mode 100644 index 0000000..1b5b374 --- /dev/null +++ b/docker/velocity/velocity.toml @@ -0,0 +1,124 @@ +# Config version. Do not change this +config-version = "2.7" + +# What port should the proxy be bound to? By default, we'll bind to all addresses on port 25577. +bind = "0.0.0.0:25577" + +# What should be the MOTD? This gets displayed when the player adds your server to +# their server list. Only MiniMessage format is accepted. +motd = "<#09add3>LunaticChat Debug Server" + +# What should we display for the maximum number of players? (Velocity does not support a cap +# on the number of players online.) +show-max-players = 3 + +# Should we authenticate players with Mojang? By default, this is on. +online-mode = false + +# Should the proxy enforce the new public key security standard? By default, this is on. +force-key-authentication = false + +# If client's ISP/AS sent from this proxy is different from the one from Mojang's +# authentication server, the player is kicked. This disallows some VPN and proxy +# connections but is a weak form of protection. +prevent-client-proxy-connections = false + +# Should we forward IP addresses and other data to backend servers? +# Available options: +# - "none": No forwarding will be done. All players will appear to be connecting +# from the proxy and will have offline-mode UUIDs. +# - "legacy": Forward player IPs and UUIDs in a BungeeCord-compatible format. Use this +# if you run servers using Minecraft 1.12 or lower. +# - "bungeeguard": Forward player IPs and UUIDs in a format supported by the BungeeGuard +# plugin. Use this if you run servers using Minecraft 1.12 or lower, and are +# unable to implement network level firewalling (on a shared host). +# - "modern": Forward player IPs and UUIDs as part of the login process using +# Velocity's native forwarding. Only applicable for Minecraft 1.13 or higher. +player-info-forwarding-mode = "NONE" + +# If you are using modern or BungeeGuard IP forwarding, configure a file that contains a unique secret here. +# The file is expected to be UTF-8 encoded and not empty. +forwarding-secret-file = "forwarding.secret" + +# Announce whether or not your server supports Forge. If you run a modded server, we +# suggest turning this on. +# +# If your network runs one modpack consistently, consider using ping-passthrough = "mods" +# instead for a nicer display in the server list. +announce-forge = false + +[query] +# Should Query be enabled? Query allows clients to request information about the server. +enabled = false + +# This is the map name that is reported to the query services. +map = "Velocity" + +# Whether plugins should be shown in query response by default or not +show-plugins = false + +[servers] +# Configure your servers here. Each key represents the server's name, and the value +# represents the IP address of the server to connect to. +s1 = "s1:25565" +s2 = "s2:25565" + +# In what order we should try servers when a player logs in or is kicked from a server. +try = [ + "s1" +] + +[forced-hosts] +# Configure your forced hosts here. + +[advanced] +# How large a Minecraft packet has to be before we compress it. Setting this to zero will +# compress all packets, and setting it to -1 will disable compression entirely. +compression-threshold = 256 + +# How much compression should be done (from 0-9). The default is -1, which uses the +# default level of 6. +compression-level = -1 + +# How fast (in milliseconds) are clients allowed to connect after the last connection? By +# default, this is three seconds. Disable this by setting this to 0. +login-ratelimit = 3000 + +# Specify a custom timeout for connection timeouts here. The default is five seconds. +connection-timeout = 5000 + +# Specify a read timeout for connections here. The default is 30 seconds. +read-timeout = 30000 + +# Enables compatibility with HAProxy's PROXY protocol. If you don't know what this is for, then +# don't enable it. +haproxy-protocol = false + +# Enables TCP fast open support on the proxy. Requires the proxy to run on Linux. +tcp-fast-open = false + +# Enables BungeeCord plugin messaging channel support on Velocity. +bungee-plugin-message-channel = true + +# Shows ping requests to the proxy from clients. +show-ping-requests = false + +# By default, Velocity will attempt to gracefully handle situations where the user unexpectedly +# loses connection to the server without an explicit disconnect message by attempting to fall the +# user back, except in the case of read timeouts. BungeeCord will disconnect the user instead. You +# can disable this setting to use the BungeeCord behavior. +failover-on-unexpected-server-disconnect = true + +# Declares the proxy commands to 1.13+ clients. +announce-proxy-commands = true + +# Enables the logging of commands +log-command-executions = false + +# Enables logging of player connections when connecting to the proxy, switching servers +# and disconnecting from the proxy. +log-player-connections = true + +# Allows players transferred from other hosts via the +# Transfer packet (Minecraft 1.20.5) to be received. +accepts-transfers = false diff --git a/x b/x index d8c998a..a1b5f29 100755 --- a/x +++ b/x @@ -2,51 +2,105 @@ set -e -DOCKER_COMPOSE="docker compose -f docker/compose.yaml" +DC_VELOCITY="docker compose -f docker/velocity/compose.yaml" +DC_FOLIA="docker compose -f docker/folia/compose.yaml" help() { cat < [options] -Commands: - start Build with gradlew and start docker compose +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 docker compose - clean Stop docker compose and remove volumes + 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 container logs + 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 EOF } +ensure_plugin_dir() { + mkdir -p "$1" +} + +# --- Folia commands --- +folia_cmd() { + case "${1:-}" in + start) + ./gradlew :platform-paper:clean :platform-paper:shadowJar + ensure_plugin_dir docker/folia/plugins + 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 "" + help + 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 - # Copy built JARs to plugin directories - cp platform-paper/build/libs/*.jar docker/plugins-paper-s1/ - cp platform-paper/build/libs/*.jar docker/plugins-paper-s2/ - cp platform-velocity/build/libs/*.jar docker/plugins-velocity/ - $DOCKER_COMPOSE up + ensure_plugin_dir docker/velocity/plugins-paper-s1 + ensure_plugin_dir docker/velocity/plugins-paper-s2 + ensure_plugin_dir docker/velocity/plugins-velocity + 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 - # Copy built JAR to s1 plugin directory - cp platform-paper/build/libs/*.jar docker/plugins-paper-s1/ - $DOCKER_COMPOSE up s1 + ensure_plugin_dir docker/velocity/plugins-paper-s1 + cp platform-paper/build/libs/*.jar docker/velocity/plugins-paper-s1/ + $DC_VELOCITY up s1 ;; restart) - $DOCKER_COMPOSE restart s1 s2 velocity + $DC_VELOCITY restart s1 s2 velocity ;; stop) - $DOCKER_COMPOSE down + $DC_VELOCITY down ;; clean) - $DOCKER_COMPOSE down -v + $DC_VELOCITY down -v ;; rcon) SERVER="${2:-s1}" @@ -54,7 +108,7 @@ case "${1:-}" in echo "Error: Invalid server '$SERVER'. Available servers: s1, s2" exit 1 fi - $DOCKER_COMPOSE exec $SERVER rcon-cli + $DC_VELOCITY exec "$SERVER" rcon-cli ;; logs) SERVER="${2:-s1}" @@ -62,10 +116,10 @@ case "${1:-}" in echo "Error: Invalid server '$SERVER'. Available servers: s1, s2" exit 1 fi - $DOCKER_COMPOSE logs -f $SERVER + $DC_VELOCITY logs -f "$SERVER" ;; vlogs) - $DOCKER_COMPOSE logs -f velocity + $DC_VELOCITY logs -f velocity ;; help|"") help -- cgit v1.2.1