Skip to content

Conversation

@jamailun
Copy link
Contributor

Current problem

The description must follow an hardcoded regular expression : ^[a-zA-Z0-9\s]+$. This does not allow players to use their language. Neither accents nor special characters are allowed, and it is impossible to add colours, although this is technically allowed.

Solution

Because the database already stores the description as a VARCHAR(255), there is no reason to restrict the server admin to an alphanumerical string for all player claims. As such, we can simply add a configuration entry to specify a regex that should be allowed for players.

Features :

  1. Two new config entries: description-regex.claims and description-regex.protected-areas. As the name implies, each one of them defines a pattern the in-game users will have to follow.
    • Splitting the two of them may allow server-admin to restrict colors only for protected areas for example.
  2. Every description (except the one in the chat when the description has ben changed) is now displayed with interpreted colours. Because the rest of the codebase uses § and ChatColor, the simplest way of doing so is with ChatColor.translateAlternateColorCodes.
  3. Changed i18n entries in the lang/ directory.

@Xyness Xyness merged commit 566a082 into Xyness:main Nov 2, 2025
1 check passed
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.

2 participants