diff options
| author | Sho Sakuma <me@m1sk9.dev> | 2026-08-10 08:31:20 +0900 |
|---|---|---|
| committer | Sho Sakuma <me@m1sk9.dev> | 2026-08-10 08:31:20 +0900 |
| commit | f08d4d8f0557581d93063cd9f6e750ab3ac9cc17 (patch) | |
| tree | 52c3bc1fbd6c0012edd3b1239f58d262e1a4e23d /website/src/docs/reference | |
| parent | f52d13819e431af39e5a8c9be178307261a12d19 (diff) | |
| download | LunaticChat-f08d4d8f0557581d93063cd9f6e750ab3ac9cc17.tar.gz LunaticChat-f08d4d8f0557581d93063cd9f6e750ab3ac9cc17.tar.bz2 LunaticChat-f08d4d8f0557581d93063cd9f6e750ab3ac9cc17.zip | |
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 <noreply@anthropic.com>
Diffstat (limited to 'website/src/docs/reference')
| -rw-r--r-- | website/src/docs/reference/commands.md | 8 | ||||
| -rw-r--r-- | website/src/docs/reference/message-format.md | 2 |
2 files changed, 10 insertions, 0 deletions
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` <Badge type="tip" text="v1.4.0~" /> + +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` <Badge type="tip" text="v1.4.0~" /> 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 | |
