azalea/azalea-chat
mat b71a7af53a
1.21.4 (#189)
* start updating to 1.21.4

* fix block codegen and stop using block data from burger

* 1.21.4-rc1

* 1.21.4
2024-12-03 14:42:23 -06:00
..
src Refactor azalea-protocol (#190) 2024-11-27 19:31:40 -06:00
tests Use an ECS (#52) 2023-02-04 19:32:27 -06:00
Cargo.toml 1.21.4 (#189) 2024-12-03 14:42:23 -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"
);