Repository navigation
feat(chat)!: restrict minimessage tags in chat by permission - #136
Merged
Merged
Conversation
<shadow_color> is not a tag in adventure 5.2.0, only <shadow>; that sample is left out. Claude-Session: https://claude.ai/code/session_01Wt7kcAoVtZTEALDSX4CxWF
Both platforms parse chat messages with ChatMessageParser, which only interprets tags the sender has butterfly.chat.tag.<type> for. Disallowed tags stay literal. Paper parses once per message instead of per viewer. BREAKING CHANGE: chat formatting now requires butterfly.chat.tag.<type> permissions; grant butterfly.chat.tag.* to the default group to restore the old behaviour. Claude-Session: https://claude.ai/code/session_01Wt7kcAoVtZTEALDSX4CxWF
Contributor
Test results 51 files 51 suites 35s ⏱️ Results for commit 6ef4ef3. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
butterfly.chat.tag.<type>for.butterfly.chat.tag.*grants all types (resolved by LuckPerms).color,decoration,gradient,rainbow,transition,pride,shadow,font,reset,newline,click,hover,insertion,keybind,translatable,selector,score,nbt,sprite,head.ChatMessageParserplusLuckPermsAPI.hasPermissioninapi.Notes:
shadow_colorwas renamed toshadow, because MiniMessage 5.2 only has<shadow>.<head>isStandardTags.sequentialHead().Tests
api(tag factory coverage, permission check, parser scenarios, enum) and 4 new Minestom chat tests../gradlew buildand./gradlew :minestom:smokeTestare green.Before merge
./gradlew :bukkit:runServerwith LuckPerms: a player without nodes sees<red>xliterally; afterlp group default permission set butterfly.chat.tag.color truethe same message is red;<click:run_command:/help>x</click>has no click event withoutbutterfly.chat.tag.click(report result here).BREAKING CHANGE
Chat formatting now requires
butterfly.chat.tag.<type>permissions. Runlp group default permission set butterfly.chat.tag.* trueto restore the old behaviour.https://claude.ai/code/session_01Wt7kcAoVtZTEALDSX4CxWF