From 1a1402954b07cd77615d0afc026c73b008787f51 Mon Sep 17 00:00:00 2001 From: Tert0 Date: Fri, 10 Oct 2025 23:19:33 +0200 Subject: 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 --- azalea-protocol/src/packets/game/c_disguised_chat.rs | 8 ++++---- azalea-protocol/src/packets/game/c_player_chat.rs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'azalea-protocol/src') 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(); -- cgit v1.2.3