# GriefPrevention3D v18.2.13
**Wiki:** https://github.com/castledking/GriefPrevention3D/wiki
## Fixes
### A color code at the start of a message ate the word after it
Putting a formatting code at the front of a message did not colorize it — it deleted the
next word:
```yaml
Messages:
IgnoringClaims: &1Now ignoring claims.
```
```
ignoring claims.
```
The message files were being read by a YAML parser, and to YAML a leading `&` is not text —
it is an **anchor declaration**. `&1Now` was consumed as an anchor named `1Now`, and the
value became whatever followed it. Nothing was logged, because as far as YAML was
concerned the file was perfectly valid.
Quoting the value (`IgnoringClaims: '&1Now ignoring claims.'`) worked around it, but only
until the next `/gpreload`: the plugin re-serialized the whole file through SnakeYAML on
load, and SnakeYAML emits scalars unquoted whenever quoting is not strictly required. The
quotes were stripped, the value was re-read as an anchor, and the word disappeared again.
The same parser rules silently swallowed other perfectly reasonable message text — a `#`
started a comment, and backslashes were escape sequences inside double-quoted values.
**Fix:** message files are no longer parsed as YAML. A new `MessageFile` reader takes
everything after `Key:` **literally**:
- `&1`, `&a`, `$e` and hex codes such as `&#ff0000` work anywhere in a message, including
the very first character, with no quoting.
- `#`, `\`, `:` and quote characters inside a message are just text.
- Quotes are still **optional**: if a value is wrapped in `'…'` or `"…"` the quotes are
stripped (with `''` → `'` and `\"` → `"`), so every existing customized `messages.yml`
keeps working exactly as it did.
- The legacy nested format (`SomeMessage:` → `Text:` / `Notes:`) still reads.
- Indentation, comments and blank lines are handled as before.
### Message files were rewritten on every load
Loading messages re-serialized the active file and saved it back. That is what stripped
quoting, but it also normalized comments and key order, and it had a more damaging edge:
if a server had **both** a locale file (`messages_de_DE.yml`) and a `messages.yml`, the
locale file's contents were saved *over* `messages.yml` on every load, discarding
customizations in it.
**Fix:** saving is now **append-only**. Existing lines — comments, ordering, whatever
quoting style the admin prefers — are left byte-for-byte intact, and only keys that are
missing from the file are appended, written single-quoted with the message's notes as a
`#` comment above them. `messages.yml` is never written unless it is the file actually in
use and it is missing keys.
### Action bar messages ignored the default message colors
Messages listed under `GriefPrevention.ActionBarMessages` were sent as raw legacy text,
while the chat path prefixes the message's `TextMode` color. Any action bar message that
did not hard-code a color of its own therefore rendered plain white — `/gpreload` output,
warnings and errors all looked identical.
**Fix:** the action bar path now prefixes the same `TextMode` color chat uses, so warnings
arrive gold, errors red, successes green and info aqua by default. A color code inside the
message still comes after the prefix and still wins, so any custom color an admin has
already set is unaffected. `UnprotectedChestWarning` is the one default action bar message
this changes — it is `TextMode.Warn` with no color of its own, so it is now gold instead of
white. The four boundary-violation messages already carry `&6` in their text and are
unchanged.
## Upstream
- **Rename `/permissiontrust` to `/managetrust` ([#2618](https://github.com/GriefPrevention/GriefPrevention/pull/2618))**:
merged upstream commit `a873b55d`, which renames the command and removes the last
non-hierarchical trust structures left over from #2507. `/permissiontrust`, `/pt` and
`/mt` remain as aliases in GriefPrevention3D, so existing commands, macros and signs
keep working. The `griefprevention.permissiontrust` permission node is unchanged. The
message key `NoPermissionTrust` is now `NoManageTrust` — if you customized that message,
rename the key in your message file; otherwise the default is used.
## Notes
Quoting message values is now purely cosmetic. Both of these produce the same result:
```yaml
IgnoringClaims: &1Now ignoring claims.
IgnoringClaims: '&1Now ignoring claims.'
```
The one behavior change to be aware of: a value that both begins *and* ends with a quote
character loses those quotes, since that is how existing quoted files are supported. Write
`He said "hi" now` rather than `"hi"` if the quotes are meant to be visible.
A handful of entries in the English message files still contain doubled apostrophes
(`You don''t have permission`) inherited from upstream's `MessageFormat` era. Message
arguments are substituted with a plain string replace, not `MessageFormat`, so those
render literally as `don''t` on unquoted lines. Cosmetic only, and unchanged by this
release.
## Tests
`MessageFileTest` — 9 cases covering unquoted color codes, quote stripping for legacy
files, literal `#`/backslash/colon handling, the nested `Text:` format, append-only saving,
no-write when nothing is missing, section creation, and a parse sweep over all 13 bundled
locale files.
## Files Changed
```
M gradle.properties
M pom.xml
M src/main/java/me/ryanhamshire/GriefPrevention/GriefPrevention.java
A src/main/java/me/ryanhamshire/GriefPrevention/MessageFile.java
M src/main/java/me/ryanhamshire/GriefPrevention/MessageLocalization.java
A src/test/java/me/ryanhamshire/GriefPrevention/MessageFileTest.java
```
Optional dependencies
QuickShop-Hikari
Any compatible version
VaultUnlocked
Any compatible version
PlaceholderAPI
Any compatible version
Developer information
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle.
maven { name = "Modrinth"; url = "https://api.modrinth.com/maven" }