Implement Discord->Minecraft Chat Formatting. #3
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.
It's pretty fun to have your messages formatted in-game.
This allows people to send messages in discord with either Legacy style, or Concord style chat formatting sequences, and it will show in-game appropriately.
The custom Concord system i implemented works as follows:
Because it leverages the TextColor parsing system, it does not work with formatting codes, such as bold or italic.
Legacy formatting consists of the old Minecraft section codes, but with an ampersand (&) instead.
A full list of Legacy sequences and the valid english-language color names, for future reference:
&0: color black
&1: color dark_blue
&2: color dark_green
&3: color dark_aqua
&4: color dark_red
&5: color dark_purple
&6: color gold
&7: color gray
&8: color dark_gray
&9: color blue
&a: color green
&b: color aqua
&c: color red
&d: color light_purple
&e: color yellow
&f: color white
&k: effect obfuscated (makes the letters scrambled and unreadable)
&l: effect bold
&m: effect strikethrough (a single thin line through the whole text)
&n: effect underline
&o: effect italic
&r: effect reset (undoes all of the effect formatting)
There are two known "issues" with this implementation:
They can both be fixed with time, but i wanted to get this code on screen for you to look at.