Skip to content

Enhancement/mc terminal colors

bobsfriend12 requested to merge enhancement/mc-terminal-colors into dev

What does this MR do and why?

This adds support for ANSI coloring codes in the server terminal. Solves issues #402 and #239. I have tested this with luckperms and a plugin called RDQ as well as a custom jar that I made, and everything appears to work.

Limitations:

  • Contrast may not be high enough to ensure readability (if someone specifies a color to close to our purple background)

For all the cases in which a background is specified for the text, it chooses between black and white depending on which has higher contrast, but if the color is specified the check doesn't work because the terminal background could change based on theme. There is a new css property called color-contrast that can automatically pick the best color, but it currently lacks browser support.

  • Will only color new lines, not lines that are loaded from log files

Screenshots or screen recordings

image image

How to set up and validate locally

Startup a server with plugins (such as luckperms and RDQ) that use ANSI coloring and open the terminal.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

  • Have you checked this doesn't interfere/conflict/duplicate someone elses work?
  • Have you fully tested your changes?
  • Have you resolved any lint issues?
  • Have you assigned a reviewer?
  • Have you applied correct labels?
Edited by bobsfriend12

Merge request reports