Skip to content

Conversation

@CitralFlo
Copy link
Member

No description provided.

@CitralFlo CitralFlo requested a review from vLuckyyy October 19, 2025 21:04
@gemini-code-assist
Copy link

Summary of Changes

Hello @CitralFlo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses and resolves issues related to legacy formatting, particularly when users do not possess the necessary permissions. It streamlines the processing of legacy color and formatting codes by consolidating the clearSection functionality and removing redundant custom processors. The changes ensure that formatting is applied accurately and consistently based on user permissions, improving the overall robustness of the chat formatting system. Additionally, it updates the project's dependencies to include LuckPerms and VaultUnlocked.

Highlights

  • Legacy Formatting Refactor: The handling of legacy color and formatting codes has been refactored, centralizing the clearSection logic within the Legacy.legacyToAdventure method and removing custom MiniMessage pre/post processors.
  • Improved Permission Checks: The permission checking mechanism for legacy formatting codes has been enhanced to provide more granular control, utilizing specific permission checks for colors and decorations.
  • Dependency Updates: The build configuration now includes LuckPerms and VaultUnlocked as plugin dependencies.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly fixes an issue where legacy formatting permissions were not being checked correctly, granting decoration permissions to users who only had color permissions. The core logic change in Legacy.java is sound and effectively resolves the bug. The associated refactoring, such as removing the LegacyPreProcessor and LegacyPostProcessor and centralizing legacy code handling, simplifies the design and improves maintainability. I've found one high-severity bug related to parsing case-insensitive hex color codes, for which I've provided a suggestion.

Comment on lines 91 to 92
String hexColor = matchResult.group().replace("&x", "").replace("&", "");
return "<#" + hexColor + ">";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

There's a bug in how case-insensitive vanilla-style hex codes (e.g., &X...) are handled. The String.replace("&x", "") call is case-sensitive and will fail to remove a prefix like &X, leading to an incorrect hex color tag such as <#X123456>. Using substring to remove the prefix would be more robust as it works regardless of case.

Suggested change
String hexColor = matchResult.group().replace("&x", "").replace("&", "");
return "<#" + hexColor + ">";
String hexColor = matchResult.group().substring(2).replace("&", "");
return "<#" + hexColor + ">";

@CitralFlo CitralFlo removed the request for review from vLuckyyy October 19, 2025 21:17
@vLuckyyy vLuckyyy linked an issue Oct 19, 2025 that may be closed by this pull request
@Rollczi Rollczi closed this Oct 21, 2025
@vLuckyyy vLuckyyy deleted the GH-182-Fix-Legacy-formatting-when-user-does-not-have-permission branch November 6, 2025 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GH-182 Legacy formatting works when user does not have permission.

3 participants