-
-
Notifications
You must be signed in to change notification settings - Fork 6
GH-134 GH-153 Fix Wrong replacement, remove chatformatter.legacycolor
permission
#156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
… permission. Signed-off-by: vLuckyyy <[email protected]>
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 (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
✨ 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
selectiveLegacyToAdventure
keeps 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!
chatformatter-core/src/main/java/com/eternalcode/formatter/legacy/Legacy.java
Show resolved
Hide resolved
chatformatter-core/src/main/java/com/eternalcode/formatter/ChatHandlerImpl.java
Outdated
Show resolved
Hide resolved
chatformatter-core/src/main/java/com/eternalcode/formatter/ChatHandlerImpl.java
Outdated
Show resolved
Hide resolved
Signed-off-by: vLuckyyy <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fuck legacy <3
If it was tested with perms the code looks perfect
Fixes: GH-134 GH-153
2025-06-17_20-31-36.mp4