GH-134 GH-153 GH-155 Fix Wrong replacement, remove chatformatter.legacycolor permission#156
Conversation
… permission. Signed-off-by: vLuckyyy <vluckyyy.biznes@gmail.com>
WalkthroughThe update clarifies the README permissions, showing that color and decoration permissions cover both old-style codes (like &c) and new MiniMessage tags (like ). The code now carefully checks if a user has permission for each legacy color or decoration code before applying it, using new methods that link codes to permissions. The build script removes one outdated permission node. Overall, the changes tidy up how legacy colors are handled and make permissions clearer and more precise. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (25)
💤 Files with no reviewable changes (6)
✅ Files skipped from review due to trivial changes (7)
🔇 Additional comments (29)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
chatformatter.legacycolor permission
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
chatformatter-core/src/main/java/com/eternalcode/formatter/legacy/Legacy.java (1)
150-175: Un-permitted codes stay as “&x” – potential double parsing
selectiveLegacyToAdventurekeeps disallowed codes in the string as&<code>.
Down-stream processors (MiniMessage pre-processors, etc.) might still translate them, undoing the permission check.A quick fix is to strip them completely when not allowed:
- return "&" + color; + return "";That fully removes the styling attempt instead of giving it a second chance.
README.md (1)
59-75: Tiny nit – “etc.” could be explicitFor
chatformatter.color.*you may list “all MiniMessage colour tags and legacy&codes” instead of “etc.” to mirror the explicit style used elsewhere.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
README.md(2 hunks)chatformatter-core/src/main/java/com/eternalcode/formatter/ChatHandlerImpl.java(1 hunks)chatformatter-core/src/main/java/com/eternalcode/formatter/legacy/Legacy.java(3 hunks)chatformatter-paper-plugin/build.gradle.kts(0 hunks)
💤 Files with no reviewable changes (1)
- chatformatter-paper-plugin/build.gradle.kts
🔇 Additional comments (2)
chatformatter-core/src/main/java/com/eternalcode/formatter/legacy/Legacy.java (1)
177-189: Wildcard helper looks goodThe helper is concise and re-usable. 👍
README.md (1)
37-47: Great clarificationThe note and table now make the colour/deco mapping crystal-clear. Nice!
Signed-off-by: vLuckyyy <vluckyyy.biznes@gmail.com>
CitralFlo
left a comment
There was a problem hiding this comment.
fuck legacy <3
If it was tested with perms the code looks perfect
…ix GSON component serialization. Simplify PlaceholderRegistry. Remove code related to ampersand shadowing. Fix run paper. Make Vault and PlaceholderAPI softly dependent. Fix junit.
chatformatter.legacycolor permissionchatformatter.legacycolor permission
Fixes: GH-134 GH-153 GH-155
2025-06-17_20-31-36.mp4