diff options
| author | Tert0 <tert0byte@gmail.com> | 2025-10-10 23:19:33 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-10 16:19:33 -0500 |
| commit | 1a1402954b07cd77615d0afc026c73b008787f51 (patch) | |
| tree | 6b0488a0ff5c5bf7b1d90ef349c06fed810532f6 /azalea-protocol/src/packets | |
| parent | ab507f7ac1c58e96bef26ba1f0e9066a35f841a7 (diff) | |
| download | azalea-drasl-1a1402954b07cd77615d0afc026c73b008787f51.tar.xz | |
Implement primitive translation arguments (#263)
* implement primitive translation arguments
* add distinct number types to PrimitiveOrComponent
* fix deserializing PrimitiveOrComponent::Boolean from nbt
* improve nbt serialization for translatable component arguments
Diffstat (limited to 'azalea-protocol/src/packets')
| -rw-r--r-- | azalea-protocol/src/packets/game/c_disguised_chat.rs | 8 | ||||
| -rw-r--r-- | azalea-protocol/src/packets/game/c_player_chat.rs | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/azalea-protocol/src/packets/game/c_disguised_chat.rs b/azalea-protocol/src/packets/game/c_disguised_chat.rs index 1242b3f7..e0225096 100644 --- a/azalea-protocol/src/packets/game/c_disguised_chat.rs +++ b/azalea-protocol/src/packets/game/c_disguised_chat.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_chat::{ FormattedText, - translatable_component::{StringOrComponent, TranslatableComponent}, + translatable_component::{PrimitiveOrComponent, TranslatableComponent}, }; use azalea_protocol_macros::ClientboundGamePacket; @@ -26,11 +26,11 @@ impl ClientboundDisguisedChat { let target = self.chat_type.target_name.clone(); let mut args = vec![ - StringOrComponent::FormattedText(sender), - StringOrComponent::FormattedText(content), + PrimitiveOrComponent::FormattedText(sender), + PrimitiveOrComponent::FormattedText(content), ]; if let Some(target) = target { - args.push(StringOrComponent::FormattedText(target)); + args.push(PrimitiveOrComponent::FormattedText(target)); } let translation_key = self.chat_type.translation_key(); diff --git a/azalea-protocol/src/packets/game/c_player_chat.rs b/azalea-protocol/src/packets/game/c_player_chat.rs index d8056d12..1e65864c 100644 --- a/azalea-protocol/src/packets/game/c_player_chat.rs +++ b/azalea-protocol/src/packets/game/c_player_chat.rs @@ -3,7 +3,7 @@ use std::io::{self, Cursor, Write}; use azalea_buf::{AzBuf, AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError}; use azalea_chat::{ FormattedText, - translatable_component::{StringOrComponent, TranslatableComponent}, + translatable_component::{PrimitiveOrComponent, TranslatableComponent}, }; use azalea_core::bitset::BitSet; use azalea_crypto::MessageSignature; @@ -106,11 +106,11 @@ impl ClientboundPlayerChat { let target = self.chat_type.target_name.clone(); let mut args = vec![ - StringOrComponent::FormattedText(sender), - StringOrComponent::FormattedText(content), + PrimitiveOrComponent::FormattedText(sender), + PrimitiveOrComponent::FormattedText(content), ]; if let Some(target) = target { - args.push(StringOrComponent::FormattedText(target)); + args.push(PrimitiveOrComponent::FormattedText(target)); } let translation_key = self.chat_type.translation_key(); |
