From c96ae8fce4e53ea9fad111ac7f479f2fa33ef859 Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 13 Dec 2021 00:07:21 -0600 Subject: start implementing joining servers --- minecraft-chat/src/text_component.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'minecraft-chat/src') diff --git a/minecraft-chat/src/text_component.rs b/minecraft-chat/src/text_component.rs index a5030fa1..25341086 100644 --- a/minecraft-chat/src/text_component.rs +++ b/minecraft-chat/src/text_component.rs @@ -27,9 +27,7 @@ pub fn legacy_color_code_to_text_component(legacy_color_code: &str) -> TextCompo if legacy_color_code.chars().nth(i).unwrap() == LEGACY_FORMATTING_CODE_SYMBOL { let formatting_code = legacy_color_code.chars().nth(i + 1).unwrap(); if let Ok(formatter) = ChatFormatting::from_code(formatting_code) { - if components.is_empty() { - components.push(TextComponent::new("".to_string())); - } else if !components.last().unwrap().text.is_empty() { + if components.is_empty() || !components.last().unwrap().text.is_empty() { components.push(TextComponent::new("".to_string())); } -- cgit v1.2.3