mirror of
https://github.com/mat-1/azalea.git
synced 2024-09-20 07:02:31 +00:00
c57c68ddf8
* Make RegistryHolder struct * Update deps * Move RegistryHolder to azalea-protocol * Convert bytes to bools and back * Rename and shuffle logic * Move logic into trait, rename methods * Final touchups * Ah, merge mistakes * Add serde support for ResourceLocation * Reuse structs * Error when serde skips values in debug mode Add missing attributes * Strict_registry feature, require packet feature * Add test * Move into packets * Docs and touchups * Reword docs * Move into module inside ClientboundLoginPacket * Add azalea-nbt serde feature * remove duplicate comment and type_ -> kind --------- Co-authored-by: mat <github@matdoes.dev> |
||
---|---|---|
.. | ||
src | ||
tests | ||
Cargo.toml | ||
README.md |
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"
);