From f08d4d8f0557581d93063cd9f6e750ab3ac9cc17 Mon Sep 17 00:00:00 2001 From: Sho Sakuma Date: Mon, 10 Aug 2026 08:31:20 +0900 Subject: feat(paper): add /lc reload to apply message formats without a restart Changing a message format meant taking the server down, because config.yml was read once in onEnable and every consumer held the value it was built with. Operators tune these formats far more often than anything else in the file, and a restart is a disproportionate price for a colour code. Only messageFormat is applied. The rest of config.yml settles things once, at startup - which services exist, which commands and listeners are registered, which files are opened - and none of that can be redone while the server runs: Paper registers commands only through its COMMANDS lifecycle event, Bukkit cannot unregister a listener, and the conversion cache saver keeps no task handle to cancel. Rebuilding the services would leave the old ones still wired up, so a changed setting the server cannot pick up is reported back as needing a restart rather than silently ignored. MessageFormatHolder is deliberately narrower than LunaticChatConfiguration: taking it says the value is live, taking the configuration says it was frozen at startup. A holder over the whole tree would hold a configuration matching no version of the file, since only messageFormat is ever swapped. Reload reads config.yml more strictly than startup does, because it has an option startup does not - leaving the running configuration alone. Startup falls a single unreadable setting back to its default so the server can come up; reload refuses the file, names every unreadable setting at once, and keeps what the server already had. A document holding no settings is refused for the same reason: it cannot be told apart from a config.yml caught halfway through being written, and resetting every format over that is worse than doing nothing. Closes #266 Co-Authored-By: Claude --- website/src/docs/reference/commands.md | 8 ++++++++ website/src/docs/reference/message-format.md | 2 ++ 2 files changed, 10 insertions(+) (limited to 'website/src/docs/reference') diff --git a/website/src/docs/reference/commands.md b/website/src/docs/reference/commands.md index 28627bc..50bcbe9 100644 --- a/website/src/docs/reference/commands.md +++ b/website/src/docs/reference/commands.md @@ -36,6 +36,14 @@ Displays the plugin version, health, enabled features, and configuration values. - **Aliases**: `st` - **Permission**: `lunaticchat.command.lc.status` +### `/lc reload` + +Re-reads `config.yml` and applies the `messageFormat` settings, then reports which of the remaining changes still need a restart. See [Applying Changes](/docs/configuration#applying-changes). + +- **Permission**: `lunaticchat.command.lc.reload` (op by default) +- **Usable from the console and RCON** +- A `config.yml` that cannot be read in full is refused, and the running configuration is kept + ### `/lc settings [key] [on|off]` Views or changes your personal settings. Without arguments, displays the settings list. diff --git a/website/src/docs/reference/message-format.md b/website/src/docs/reference/message-format.md index 2669adb..68fee84 100644 --- a/website/src/docs/reference/message-format.md +++ b/website/src/docs/reference/message-format.md @@ -6,6 +6,8 @@ layout: doc You can customize the display format of chat messages in the `messageFormat` section of `config.yml`. +These are the only settings `/lc reload` applies without a restart; every other section of `config.yml` is fixed when the server starts. See [Applying Changes](/docs/configuration#applying-changes). + ## Placeholders | Placeholder | Description | Available formats | -- cgit v1.2.1