diff options
| author | mat <github@matdoes.dev> | 2022-12-03 01:22:34 -0600 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-12-03 01:22:34 -0600 |
| commit | 661c3622bebc111a1523bc80792dc90d9d571b24 (patch) | |
| tree | d605a758f6fcfc5001223f96a380b5acbc551b3e /azalea-client/src/chat.rs | |
| parent | 8fd88aeae85932b8d9e9c67df0be3d01d499ce72 (diff) | |
| download | azalea-drasl-661c3622bebc111a1523bc80792dc90d9d571b24.tar.xz | |
make the packets in events be Arc
so they're cheap to clone
Diffstat (limited to 'azalea-client/src/chat.rs')
| -rwxr-xr-x | azalea-client/src/chat.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/azalea-client/src/chat.rs b/azalea-client/src/chat.rs index 5f566fe7..26f37d58 100755 --- a/azalea-client/src/chat.rs +++ b/azalea-client/src/chat.rs @@ -9,13 +9,16 @@ use azalea_protocol::packets::game::{ serverbound_chat_command_packet::ServerboundChatCommandPacket, serverbound_chat_packet::ServerboundChatPacket, }; -use std::time::{SystemTime, UNIX_EPOCH}; +use std::{ + sync::Arc, + time::{SystemTime, UNIX_EPOCH}, +}; /// A chat packet, either a system message or a chat message. #[derive(Debug, Clone, PartialEq)] pub enum ChatPacket { - System(ClientboundSystemChatPacket), - Player(Box<ClientboundPlayerChatPacket>), + System(Arc<ClientboundSystemChatPacket>), + Player(Arc<ClientboundPlayerChatPacket>), } macro_rules! regex { |
