Add optional web jukebox: vote for arena music tracks via a small HTTP API
Build / build (push) Successful in 1m19s

This commit is contained in:
Michael Burgess
2026-08-07 11:46:43 -04:00
parent a29f359009
commit bdb18f9952
10 changed files with 475 additions and 8 deletions
+29
View File
@@ -30,6 +30,35 @@ music:
track: MUSIC_DISC_PIGSTEP
volume: 1.0
jukebox:
# Lets players vote for an arena's music track from a web page, live. OFF by default:
# enabling this opens a plain HTTP port on this machine. You are responsible for
# firewalling it and putting it behind an HTTPS reverse proxy (Caddy/nginx/Cloudflare
# Tunnel/etc.) - a browser page served over HTTPS (e.g. a published Claude Artifact)
# cannot call a plain http:// address due to mixed-content blocking, and exposing raw
# HTTP directly to the internet is not recommended. See README "Jukebox" for setup.
enabled: false
bind-address: 127.0.0.1
port: 8642
# CORS origin allowed to call the API. "*" allows any page; tighten this to your
# actual voting page's origin if you want to restrict it.
allowed-origin: "*"
# How long a /blockparty musicvote code stays valid, in minutes.
vote-code-minutes: 10
# id|label pairs offered to voters. "id" must be a valid Bukkit Sound enum name.
tracks:
- "MUSIC_DISC_PIGSTEP|Pigstep"
- "MUSIC_DISC_CAT|Cat"
- "MUSIC_DISC_BLOCKS|Blocks"
- "MUSIC_DISC_CHIRP|Chirp"
- "MUSIC_DISC_FAR|Far"
- "MUSIC_DISC_MELLOHI|Mellohi"
- "MUSIC_DISC_STAL|Stal"
- "MUSIC_DISC_STRAD|Strad"
- "MUSIC_DISC_WARD|Ward"
- "MUSIC_DISC_11|13"
- "MUSIC_DISC_WAIT|Wait"
performance:
# blocks processed per server tick when generating/removing/restoring the floor
floor-blocks-per-tick: 200
+2
View File
@@ -9,6 +9,7 @@ errors:
arena-full: "<red>Arena '%arena%' is full.</red>"
no-region: "<red>Arena '%arena%' has no floor region set (use pos1/pos2).</red>"
no-materials: "<red>Arena '%arena%' has no floor materials configured.</red>"
jukebox-disabled: "<red>The music jukebox is not enabled on this server.</red>"
admin:
arena-exists: "<red>Arena '%arena%' already exists.</red>"
@@ -34,6 +35,7 @@ admin:
player:
joined: "<green>You joined arena '%arena%'.</green>"
left: "<yellow>You left the arena.</yellow>"
musicvote-code: "<green>Your music vote code: <bold>%code%</bold></green> <gray>(valid %minutes% minutes) - enter it on the jukebox voting page to pick the next track.</gray>"
countdown:
actionbar: "<yellow>Starting in %time%s...</yellow>"