aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src/chat.rs
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-12-11 00:15:37 -0600
committermat <github@matdoes.dev>2022-12-11 00:15:37 -0600
commit37b9f10b3bcc74b48df2c6843a5286a7d41e2414 (patch)
tree6a995f7ad3f3309e57c276e10dc7e655dae9c5bb /azalea-client/src/chat.rs
parent2d6737b247b74e964fd734d5ab4828a3193c296f (diff)
downloadazalea-drasl-37b9f10b3bcc74b48df2c6843a5286a7d41e2414.tar.xz
make entities have a reference to WeakWorlds instead
... and other exciting bug fixes
Diffstat (limited to 'azalea-client/src/chat.rs')
-rwxr-xr-xazalea-client/src/chat.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/azalea-client/src/chat.rs b/azalea-client/src/chat.rs
index 510bf043..fa88daf7 100755
--- a/azalea-client/src/chat.rs
+++ b/azalea-client/src/chat.rs
@@ -78,6 +78,15 @@ impl ChatPacket {
pub fn content(&self) -> String {
self.split_sender_and_content().1
}
+
+ /// Create a new ChatPacket from a string. This is meant to be used as a
+ /// convenience function for testing.
+ pub fn new(message: &str) -> Self {
+ ChatPacket::System(Arc::new(ClientboundSystemChatPacket {
+ content: Component::from(message),
+ overlay: false,
+ }))
+ }
}
impl Client {