Commit d3a04e2
Fix BungeeCord hex colour format not recognised in legacyToMiniMessage
translateColorCodes serialises &#RRGGBB to §x§R§R§G§G§B§B (BungeeCord
format) via LegacyComponentSerializer. When that string was subsequently
passed to parseMiniMessageOrLegacy → legacyToMiniMessage, the &x prefix
was silently ignored and each following &R digit was misread as a named
colour code (&2 = dark_green, &3 = dark_aqua, …), producing completely
wrong colours.
Fix: after normalising § to &, detect the &x&R&R&G&G&B&B pattern in
both legacyToMiniMessage and replaceLegacyCodesInline and convert it to
the &#RRGGBB form that HEX_PATTERN already handles.
Fixes #2943
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 6bdd0cd commit d3a04e2
2 files changed
Lines changed: 78 additions & 0 deletions
File tree
- src
- main/java/world/bentobox/bentobox/util
- test/java/world/bentobox/bentobox/util
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
101 | 108 | | |
102 | 109 | | |
103 | 110 | | |
| |||
1047 | 1054 | | |
1048 | 1055 | | |
1049 | 1056 | | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
1050 | 1074 | | |
1051 | 1075 | | |
1052 | 1076 | | |
| |||
1211 | 1235 | | |
1212 | 1236 | | |
1213 | 1237 | | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
1214 | 1250 | | |
1215 | 1251 | | |
1216 | 1252 | | |
| |||
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
285 | 286 | | |
286 | 287 | | |
287 | 288 | | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
288 | 330 | | |
0 commit comments