1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 23:44:38 +00:00
azalea/azalea-chat
Shayne Hartford 5a460f3871
Fix 1.20.4 branch (#193)
* Add rust rover to .gitignore

* Downgrade to last working nightly version

* Update dependencies and set the simdnbt revision because version doesn't work with git, only path.

* Disable cursor_remaining stabilized feature
2024-12-04 18:09:28 -06:00
..
src Fix 1.20.4 branch (#193) 2024-12-04 18:09:28 -06:00
tests Use an ECS (#52) 2023-02-04 19:32:27 -06:00
Cargo.toml Fix 1.20.4 branch (#193) 2024-12-04 18:09:28 -06:00
README.md Use an ECS (#52) 2023-02-04 19:32:27 -06:00

Azalea Chat

Things for working with Minecraft formatted text components.

Examples

// convert a Minecraft formatted text JSON into colored text that can be printed to the terminal.

use azalea_chat::FormattedText;
use serde_json::Value;
use serde::Deserialize;

let j: Value = serde_json::from_str(
    r#"{"text": "hello","color": "red","bold": true}"#
)
.unwrap();
let text = FormattedText::deserialize(&j).unwrap();
assert_eq!(
    text.to_ansi(),
    "\u{1b}[1m\u{1b}[38;2;255;85;85mhello\u{1b}[m"
);