diff --git a/.github/workflows/typos.yml b/.github/workflows/typos.yml index 666e38aab..a9828efbe 100644 --- a/.github/workflows/typos.yml +++ b/.github/workflows/typos.yml @@ -18,4 +18,4 @@ jobs: - name: Checkout Actions Repository uses: actions/checkout@v4 - name: Spell Check Repo - uses: crate-ci/typos@v1.29.5 \ No newline at end of file + uses: crate-ci/typos@v1.29.7 \ No newline at end of file diff --git a/pumpkin-util/src/text/mod.rs b/pumpkin-util/src/text/mod.rs index 0141e7483..5647144e3 100644 --- a/pumpkin-util/src/text/mod.rs +++ b/pumpkin-util/src/text/mod.rs @@ -91,14 +91,15 @@ impl TextComponent { }) } - pub fn translate(key: K, with: Vec) -> Self + pub fn translate(key: K, with: W) -> Self where K: Into>, + W: Into>, { Self(TextComponentBase { content: TextContent::Translate { translate: key.into(), - with: with.into_iter().map(|x| x.0).collect(), + with: with.into().into_iter().map(|x| x.0).collect(), }, style: Style::default(), extra: vec![], @@ -271,7 +272,7 @@ mod test { fn test_serialize_text_component() { let msg_comp = TextComponent::translate( "multiplayer.player.joined", - [TextComponent::text("NAME".to_string())].into(), + [TextComponent::text("NAME".to_string())], ) .color_named(NamedColor::Yellow); diff --git a/pumpkin/src/command/commands/ban.rs b/pumpkin/src/command/commands/ban.rs index 51b585065..df2301940 100644 --- a/pumpkin/src/command/commands/ban.rs +++ b/pumpkin/src/command/commands/ban.rs @@ -70,7 +70,7 @@ async fn ban_player(sender: &CommandSender<'_>, player: &Player, reason: Option< if banned_players.get_entry(&player.gameprofile).is_some() { sender - .send_message(TextComponent::translate("commands.ban.failed", [].into())) + .send_message(TextComponent::translate("commands.ban.failed", [])) .await; return; } @@ -92,15 +92,14 @@ async fn ban_player(sender: &CommandSender<'_>, player: &Player, reason: Option< [ TextComponent::text(player.gameprofile.name.clone()), TextComponent::text(reason), - ] - .into(), + ], )) .await; player .kick(TextComponent::translate( "multiplayer.disconnect.banned", - [].into(), + [], )) .await; } diff --git a/pumpkin/src/command/commands/banip.rs b/pumpkin/src/command/commands/banip.rs index e618b801e..fd8330af2 100644 --- a/pumpkin/src/command/commands/banip.rs +++ b/pumpkin/src/command/commands/banip.rs @@ -83,10 +83,7 @@ async fn ban_ip(sender: &CommandSender<'_>, server: &Server, target: &str, reaso let Some(target_ip) = parse_ip(target, server).await else { sender - .send_message(TextComponent::translate( - "commands.banip.invalid", - [].into(), - )) + .send_message(TextComponent::translate("commands.banip.invalid", [])) .await; return; }; @@ -95,7 +92,7 @@ async fn ban_ip(sender: &CommandSender<'_>, server: &Server, target: &str, reaso if banned_ips.get_entry(&target_ip).is_some() { sender - .send_message(TextComponent::translate("commands.banip.failed", [].into())) + .send_message(TextComponent::translate("commands.banip.failed", [])) .await; return; } @@ -124,8 +121,7 @@ async fn ban_ip(sender: &CommandSender<'_>, server: &Server, target: &str, reaso [ TextComponent::text(target_ip.to_string()), TextComponent::text(reason), - ] - .into(), + ], )) .await; @@ -135,8 +131,7 @@ async fn ban_ip(sender: &CommandSender<'_>, server: &Server, target: &str, reaso [ TextComponent::text(affected.len().to_string()), TextComponent::text(names), - ] - .into(), + ], )) .await; @@ -144,7 +139,7 @@ async fn ban_ip(sender: &CommandSender<'_>, server: &Server, target: &str, reaso target .kick(TextComponent::translate( "multiplayer.disconnect.ip_banned", - [].into(), + [], )) .await; } diff --git a/pumpkin/src/command/commands/banlist.rs b/pumpkin/src/command/commands/banlist.rs index 1a75fc2ab..f5f09b709 100644 --- a/pumpkin/src/command/commands/banlist.rs +++ b/pumpkin/src/command/commands/banlist.rs @@ -110,7 +110,7 @@ impl CommandExecutor for BanListAllExecutor { async fn handle_banlist(list: Vec<(String, String, String)>, sender: &CommandSender<'_>) { if list.is_empty() { sender - .send_message(TextComponent::translate("commands.banlist.none", [].into())) + .send_message(TextComponent::translate("commands.banlist.none", [])) .await; return; } @@ -118,7 +118,7 @@ async fn handle_banlist(list: Vec<(String, String, String)>, sender: &CommandSen sender .send_message(TextComponent::translate( "commands.banlist.list", - [TextComponent::text(list.len().to_string())].into(), + [TextComponent::text(list.len().to_string())], )) .await; @@ -130,8 +130,7 @@ async fn handle_banlist(list: Vec<(String, String, String)>, sender: &CommandSen TextComponent::text(name), TextComponent::text(source), TextComponent::text(reason), - ] - .into(), + ], )) .await; } diff --git a/pumpkin/src/command/commands/bossbar.rs b/pumpkin/src/command/commands/bossbar.rs index 045e3b29a..a2d9bcea2 100644 --- a/pumpkin/src/command/commands/bossbar.rs +++ b/pumpkin/src/command/commands/bossbar.rs @@ -76,7 +76,7 @@ impl CommandExecutor for BossbarAddExecuter { sender, TextComponent::translate( "commands.bossbar.create.failed", - vec![TextComponent::text(namespace.to_string())], + [TextComponent::text(namespace.to_string())], ), ) .await; @@ -93,7 +93,7 @@ impl CommandExecutor for BossbarAddExecuter { sender .send_message(TextComponent::translate( "commands.bossbar.create.success", - vec![bossbar_prefix(bossbar.title.clone(), namespace.to_string())], + [bossbar_prefix(bossbar.title.clone(), namespace.to_string())], )) .await; @@ -129,7 +129,7 @@ impl CommandExecutor for BossbarGetExecuter { sender .send_message(TextComponent::translate( "commands.bossbar.get.max", - vec![ + [ bossbar_prefix( bossbar.bossbar_data.title.clone(), namespace.to_string(), @@ -145,7 +145,7 @@ impl CommandExecutor for BossbarGetExecuter { sender .send_message(TextComponent::translate( "commands.bossbar.get.value", - vec![ + [ bossbar_prefix( bossbar.bossbar_data.title.clone(), namespace.to_string(), @@ -165,7 +165,7 @@ impl CommandExecutor for BossbarGetExecuter { sender .send_message(TextComponent::translate( state, - vec![bossbar_prefix( + [bossbar_prefix( bossbar.bossbar_data.title.clone(), namespace.to_string(), )], @@ -194,7 +194,7 @@ impl CommandExecutor for BossbarListExecuter { sender .send_message(TextComponent::translate( "commands.bossbar.list.bars.none", - vec![], + [], )) .await; return Ok(()); @@ -203,7 +203,7 @@ impl CommandExecutor for BossbarListExecuter { sender .send_message(TextComponent::translate( "commands.bossbar.list.bars.none", - vec![], + [], )) .await; return Ok(()); @@ -228,7 +228,7 @@ impl CommandExecutor for BossbarListExecuter { sender .send_message(TextComponent::translate( "commands.bossbar.list.bars.some", - vec![ + [ TextComponent::text(bossbars.len().to_string()), bossbars_text, ], @@ -264,7 +264,7 @@ impl CommandExecutor for BossbarRemoveExecuter { sender .send_message(TextComponent::translate( "commands.bossbar.remove.success", - vec![bossbar_prefix( + [bossbar_prefix( bossbar.bossbar_data.title.clone(), namespace.to_string(), )], @@ -330,7 +330,7 @@ impl CommandExecutor for BossbarSetExecuter { sender .send_message(TextComponent::translate( "commands.bossbar.set.color.success", - vec![bossbar_prefix( + [bossbar_prefix( bossbar.bossbar_data.title.clone(), namespace.to_string(), )], @@ -344,7 +344,7 @@ impl CommandExecutor for BossbarSetExecuter { sender, TextComponent::translate( "parsing.int.invalid", - vec![TextComponent::text(i32::MAX.to_string())], + [TextComponent::text(i32::MAX.to_string())], ), ) .await; @@ -373,7 +373,7 @@ impl CommandExecutor for BossbarSetExecuter { sender .send_message(TextComponent::translate( "commands.bossbar.set.max.success", - vec![ + [ bossbar_prefix( bossbar.bossbar_data.title.clone(), namespace.to_string(), @@ -403,7 +403,7 @@ impl CommandExecutor for BossbarSetExecuter { sender .send_message(TextComponent::translate( "commands.bossbar.set.name.success", - vec![bossbar_prefix(text_component, namespace.to_string())], + [bossbar_prefix(text_component, namespace.to_string())], )) .await; Ok(()) @@ -426,7 +426,7 @@ impl CommandExecutor for BossbarSetExecuter { sender .send_message(TextComponent::translate( "commands.bossbar.set.players.success.none", - vec![bossbar_prefix( + [bossbar_prefix( bossbar.bossbar_data.title.clone(), namespace.to_string(), )], @@ -463,7 +463,7 @@ impl CommandExecutor for BossbarSetExecuter { sender .send_message(TextComponent::translate( "commands.bossbar.set.players.success.some", - vec![ + [ bossbar_prefix( bossbar.bossbar_data.title.clone(), namespace.to_string(), @@ -493,7 +493,7 @@ impl CommandExecutor for BossbarSetExecuter { sender .send_message(TextComponent::translate( "commands.bossbar.set.style.success", - vec![bossbar_prefix( + [bossbar_prefix( bossbar.bossbar_data.title.clone(), namespace.to_string(), )], @@ -507,7 +507,7 @@ impl CommandExecutor for BossbarSetExecuter { sender, TextComponent::translate( "parsing.int.invalid", - vec![TextComponent::text(i32::MAX.to_string())], + [TextComponent::text(i32::MAX.to_string())], ), ) .await; @@ -531,7 +531,7 @@ impl CommandExecutor for BossbarSetExecuter { sender .send_message(TextComponent::translate( "commands.bossbar.set.value.success", - vec![ + [ bossbar_prefix( bossbar.bossbar_data.title.clone(), namespace.to_string(), @@ -568,7 +568,7 @@ impl CommandExecutor for BossbarSetExecuter { sender .send_message(TextComponent::translate( state, - vec![bossbar_prefix( + [bossbar_prefix( bossbar.bossbar_data.title.clone(), namespace.to_string(), )], @@ -682,7 +682,7 @@ async fn handle_bossbar_error(sender: &CommandSender<'_>, error: BossbarUpdateEr sender, TextComponent::translate( "commands.bossbar.unknown", - vec![TextComponent::text(location)], + [TextComponent::text(location)], ), ) .await; @@ -695,7 +695,7 @@ async fn handle_bossbar_error(sender: &CommandSender<'_>, error: BossbarUpdateEr key.push_str(&format!(".{variation}")); } - send_error_message(sender, TextComponent::translate(key, vec![])).await; + send_error_message(sender, TextComponent::translate(key, [])).await; } } } diff --git a/pumpkin/src/command/commands/clear.rs b/pumpkin/src/command/commands/clear.rs index 2b126d676..478be7886 100644 --- a/pumpkin/src/command/commands/clear.rs +++ b/pumpkin/src/command/commands/clear.rs @@ -40,12 +40,12 @@ fn clear_command_text_output(item_count: usize, targets: &[Arc]) -> Text match targets { [target] if item_count == 0 => TextComponent::translate( "clear.failed.single", - vec![TextComponent::text(target.gameprofile.name.clone())], + [TextComponent::text(target.gameprofile.name.clone())], ) .color_named(NamedColor::Red), [target] => TextComponent::translate( "commands.clear.success.single", - vec![ + [ TextComponent::text(item_count.to_string()), TextComponent::text(target.gameprofile.name.clone()) .click_event(ClickEvent::SuggestCommand( @@ -60,12 +60,12 @@ fn clear_command_text_output(item_count: usize, targets: &[Arc]) -> Text ), targets if item_count == 0 => TextComponent::translate( "clear.failed.multiple", - vec![TextComponent::text(targets.len().to_string())], + [TextComponent::text(targets.len().to_string())], ) .color_named(NamedColor::Red), targets => TextComponent::translate( "commands.clear.success.multiple", - vec![ + [ TextComponent::text(item_count.to_string()), TextComponent::text(targets.len().to_string()), ], diff --git a/pumpkin/src/command/commands/damage.rs b/pumpkin/src/command/commands/damage.rs index acf788a34..dbe4537d7 100644 --- a/pumpkin/src/command/commands/damage.rs +++ b/pumpkin/src/command/commands/damage.rs @@ -41,7 +41,7 @@ async fn send_damage_result( if !success { sender .send_message( - TextComponent::translate("commands.damage.invulnerable", [].into()) + TextComponent::translate("commands.damage.invulnerable", []) .color(Color::Named(NamedColor::Red)), ) .await; @@ -54,8 +54,7 @@ async fn send_damage_result( [ TextComponent::text(amount.to_string()), TextComponent::text(target_name), - ] - .into(), + ], )) .await; } diff --git a/pumpkin/src/command/commands/deop.rs b/pumpkin/src/command/commands/deop.rs index c4fc94993..ce6e98661 100644 --- a/pumpkin/src/command/commands/deop.rs +++ b/pumpkin/src/command/commands/deop.rs @@ -51,7 +51,7 @@ impl CommandExecutor for DeopExecutor { let player_name = &player.gameprofile.name; let msg = TextComponent::translate( "commands.deop.success", - [TextComponent::text(player_name.clone())].into(), + [TextComponent::text(player_name.clone())], ); sender.send_message(msg).await; } diff --git a/pumpkin/src/command/commands/experience.rs b/pumpkin/src/command/commands/experience.rs index 3b2d984fa..73cf9633a 100644 --- a/pumpkin/src/command/commands/experience.rs +++ b/pumpkin/src/command/commands/experience.rs @@ -59,8 +59,7 @@ impl ExperienceExecutor { [ TextComponent::text(target.gameprofile.name.clone()), TextComponent::text(level.to_string()), - ] - .into(), + ], )) .await; } @@ -72,8 +71,7 @@ impl ExperienceExecutor { [ TextComponent::text(target.gameprofile.name.clone()), TextComponent::text(points.to_string()), - ] - .into(), + ], )) .await; } @@ -95,8 +93,7 @@ impl ExperienceExecutor { [ TextComponent::text(amount.to_string()), TextComponent::text(targets_len.to_string()), - ] - .into(), + ], ) } else { TextComponent::translate( @@ -104,8 +101,7 @@ impl ExperienceExecutor { [ TextComponent::text(amount.to_string()), TextComponent::text(target_name.unwrap()), - ] - .into(), + ], ) } } @@ -116,8 +112,7 @@ impl ExperienceExecutor { [ TextComponent::text(amount.to_string()), TextComponent::text(targets_len.to_string()), - ] - .into(), + ], ) } else { TextComponent::translate( @@ -125,8 +120,7 @@ impl ExperienceExecutor { [ TextComponent::text(amount.to_string()), TextComponent::text(target_name.unwrap()), - ] - .into(), + ], ) } } @@ -137,8 +131,7 @@ impl ExperienceExecutor { [ TextComponent::text(amount.to_string()), TextComponent::text(targets_len.to_string()), - ] - .into(), + ], ) } else { TextComponent::translate( @@ -146,8 +139,7 @@ impl ExperienceExecutor { [ TextComponent::text(amount.to_string()), TextComponent::text(target_name.unwrap()), - ] - .into(), + ], ) } } @@ -158,8 +150,7 @@ impl ExperienceExecutor { [ TextComponent::text(amount.to_string()), TextComponent::text(targets_len.to_string()), - ] - .into(), + ], ) } else { TextComponent::translate( @@ -167,8 +158,7 @@ impl ExperienceExecutor { [ TextComponent::text(amount.to_string()), TextComponent::text(target_name.unwrap()), - ] - .into(), + ], ) } } @@ -236,7 +226,7 @@ impl CommandExecutor for ExperienceExecutor { sender .send_message(TextComponent::translate( "commands.experience.set.points.invalid", - [].into(), + [], )) .await; return Ok(()); @@ -246,7 +236,7 @@ impl CommandExecutor for ExperienceExecutor { sender .send_message(TextComponent::translate( "commands.experience.set.points.invalid", - [].into(), + [], )) .await; return Ok(()); @@ -270,7 +260,7 @@ impl CommandExecutor for ExperienceExecutor { Err(error_msg) => { sender .send_message( - TextComponent::translate(error_msg, [].into()) + TextComponent::translate(error_msg, []) .color(Color::Named(NamedColor::Red)), ) .await; diff --git a/pumpkin/src/command/commands/fill.rs b/pumpkin/src/command/commands/fill.rs index 05a278815..6fada48b6 100644 --- a/pumpkin/src/command/commands/fill.rs +++ b/pumpkin/src/command/commands/fill.rs @@ -151,7 +151,7 @@ impl CommandExecutor for SetblockExecutor { sender .send_message(TextComponent::translate( "commands.fill.success", - [TextComponent::text(placed_blocks.to_string())].into(), + [TextComponent::text(placed_blocks.to_string())], )) .await; diff --git a/pumpkin/src/command/commands/gamemode.rs b/pumpkin/src/command/commands/gamemode.rs index 495add095..016bd8eb6 100644 --- a/pumpkin/src/command/commands/gamemode.rs +++ b/pumpkin/src/command/commands/gamemode.rs @@ -45,7 +45,7 @@ impl CommandExecutor for GamemodeTargetSelf { target .send_system_message(&TextComponent::translate( "commands.gamemode.success.self", - [TextComponent::translate(gamemode_string, [].into())].into(), + [TextComponent::translate(gamemode_string, [])], )) .await; } @@ -83,7 +83,7 @@ impl CommandExecutor for GamemodeTargetPlayer { target .send_system_message(&TextComponent::translate( "gameMode.changed", - [TextComponent::translate(gamemode_string.clone(), [].into())].into(), + [TextComponent::translate(gamemode_string.clone(), [])], )) .await; if target_count == 1 { @@ -92,9 +92,8 @@ impl CommandExecutor for GamemodeTargetPlayer { "commands.gamemode.success.other", [ TextComponent::text(target.gameprofile.name.clone()), - TextComponent::translate(gamemode_string, [].into()), - ] - .into(), + TextComponent::translate(gamemode_string, []), + ], )) .await; } diff --git a/pumpkin/src/command/commands/give.rs b/pumpkin/src/command/commands/give.rs index e32bf8e0b..9c2184383 100644 --- a/pumpkin/src/command/commands/give.rs +++ b/pumpkin/src/command/commands/give.rs @@ -83,8 +83,7 @@ impl CommandExecutor for GiveExecutor { .click_event(ClickEvent::SuggestCommand( format!("/tell {} ", targets[0].gameprofile.name.clone()).into(), )), - ] - .into(), + ], ) } else { TextComponent::translate( @@ -100,8 +99,7 @@ impl CommandExecutor for GiveExecutor { tag: None, }), TextComponent::text(targets.len().to_string()), - ] - .into(), + ], ) }; sender.send_message(msg).await; diff --git a/pumpkin/src/command/commands/kick.rs b/pumpkin/src/command/commands/kick.rs index 48c66c4f5..c0d3c492d 100644 --- a/pumpkin/src/command/commands/kick.rs +++ b/pumpkin/src/command/commands/kick.rs @@ -34,7 +34,7 @@ impl CommandExecutor for KickExecutor { let reason = match args.get(&ARG_REASON) { Some(Arg::Msg(r)) => TextComponent::text(r.clone()), - _ => TextComponent::translate("multiplayer.disconnect.kicked", [].into()), + _ => TextComponent::translate("multiplayer.disconnect.kicked", []), }; for target in targets { diff --git a/pumpkin/src/command/commands/kill.rs b/pumpkin/src/command/commands/kill.rs index 9a5b38f11..03ffd16ce 100644 --- a/pumpkin/src/command/commands/kill.rs +++ b/pumpkin/src/command/commands/kill.rs @@ -52,11 +52,11 @@ impl CommandExecutor for KillExecutor { )); } - TextComponent::translate("commands.kill.success.single", [entity_display].into()) + TextComponent::translate("commands.kill.success.single", [entity_display]) } else { TextComponent::translate( "commands.kill.success.multiple", - [TextComponent::text(target_count.to_string())].into(), + [TextComponent::text(target_count.to_string())], ) }; @@ -93,8 +93,7 @@ impl CommandExecutor for KillSelfExecutor { )) .click_event(ClickEvent::SuggestCommand( format!("/tell {} ", name.clone()).into(), - ))] - .into(), + ))], )) .await; diff --git a/pumpkin/src/command/commands/list.rs b/pumpkin/src/command/commands/list.rs index 5c86c70c2..b1cc81621 100644 --- a/pumpkin/src/command/commands/list.rs +++ b/pumpkin/src/command/commands/list.rs @@ -34,8 +34,7 @@ impl CommandExecutor for ListExecutor { TextComponent::text(players.len().to_string()), TextComponent::text(BASIC_CONFIG.max_players.to_string()), TextComponent::text(get_player_names(players)), - ] - .into(), + ], )) .await; diff --git a/pumpkin/src/command/commands/op.rs b/pumpkin/src/command/commands/op.rs index 0ca779086..8fae81ba4 100644 --- a/pumpkin/src/command/commands/op.rs +++ b/pumpkin/src/command/commands/op.rs @@ -39,7 +39,7 @@ impl CommandExecutor for OpExecutor { if player.permission_lvl.load() == new_level { sender - .send_message(TextComponent::translate("commands.op.failed", [].into())) + .send_message(TextComponent::translate("commands.op.failed", [])) .await; continue; } @@ -70,7 +70,7 @@ impl CommandExecutor for OpExecutor { sender .send_message(TextComponent::translate( "commands.op.success", - [TextComponent::text(player_name.clone())].into(), + [TextComponent::text(player_name.clone())], )) .await; } diff --git a/pumpkin/src/command/commands/pardon.rs b/pumpkin/src/command/commands/pardon.rs index f98c6f6a3..5fb79cb23 100644 --- a/pumpkin/src/command/commands/pardon.rs +++ b/pumpkin/src/command/commands/pardon.rs @@ -41,10 +41,7 @@ impl CommandExecutor for PardonExecutor { lock.banned_players.remove(idx); } else { sender - .send_message(TextComponent::translate( - "commands.pardon.failed", - [].into(), - )) + .send_message(TextComponent::translate("commands.pardon.failed", [])) .await; return Ok(()); } @@ -54,7 +51,7 @@ impl CommandExecutor for PardonExecutor { sender .send_message(TextComponent::translate( "commands.pardon.success", - [TextComponent::text(target)].into(), + [TextComponent::text(target)], )) .await; Ok(()) diff --git a/pumpkin/src/command/commands/pardonip.rs b/pumpkin/src/command/commands/pardonip.rs index da1c80b0a..2ca2b2e71 100644 --- a/pumpkin/src/command/commands/pardonip.rs +++ b/pumpkin/src/command/commands/pardonip.rs @@ -34,10 +34,7 @@ impl CommandExecutor for PardonIpExecutor { let Ok(ip) = IpAddr::from_str(target) else { sender - .send_message(TextComponent::translate( - "commands.pardonip.invalid", - [].into(), - )) + .send_message(TextComponent::translate("commands.pardonip.invalid", [])) .await; return Ok(()); }; @@ -48,10 +45,7 @@ impl CommandExecutor for PardonIpExecutor { lock.banned_ips.remove(idx); } else { sender - .send_message(TextComponent::translate( - "commands.pardonip.failed", - [].into(), - )) + .send_message(TextComponent::translate("commands.pardonip.failed", [])) .await; return Ok(()); } @@ -61,7 +55,7 @@ impl CommandExecutor for PardonIpExecutor { sender .send_message(TextComponent::translate( "commands.pardonip.success", - [TextComponent::text(ip.to_string())].into(), + [TextComponent::text(ip.to_string())], )) .await; Ok(()) diff --git a/pumpkin/src/command/commands/particle.rs b/pumpkin/src/command/commands/particle.rs index c695dbf6d..934f05c45 100644 --- a/pumpkin/src/command/commands/particle.rs +++ b/pumpkin/src/command/commands/particle.rs @@ -52,7 +52,7 @@ impl CommandExecutor for ParticleExecutor { sender .send_message(TextComponent::translate( "commands.particle.success", - [TextComponent::text(format!("{particle:?}"))].into(), + [TextComponent::text(format!("{particle:?}"))], )) .await; } diff --git a/pumpkin/src/command/commands/playsound.rs b/pumpkin/src/command/commands/playsound.rs index 5bba93ce6..6f82a393a 100644 --- a/pumpkin/src/command/commands/playsound.rs +++ b/pumpkin/src/command/commands/playsound.rs @@ -80,9 +80,9 @@ impl CommandExecutor for SoundExecutor { // Get target players, defaults to sender if not specified let targets = if let Ok(players) = PlayersArgumentConsumer::find_arg(args, ARG_TARGETS) { - players.to_vec() + players } else if let Some(player) = sender.as_player() { - vec![player.clone()] + &[player.clone()] } else { return Ok(()); }; @@ -115,7 +115,7 @@ impl CommandExecutor for SoundExecutor { let mut players_who_heard = 0; // Play sound for each target player - for target in &targets { + for target in targets { let pos = position.unwrap_or(target.living_entity.entity.pos.load()); // Check if player can hear the sound based on volume and distance @@ -134,10 +134,7 @@ impl CommandExecutor for SoundExecutor { // Send appropriate message based on results if players_who_heard == 0 { sender - .send_message(TextComponent::translate( - "commands.playsound.failed", - [].into(), - )) + .send_message(TextComponent::translate("commands.playsound.failed", [])) .await; } else { let sound_name = sound.to_name(); @@ -148,8 +145,7 @@ impl CommandExecutor for SoundExecutor { [ TextComponent::text(sound_name), TextComponent::text(targets[0].gameprofile.name.clone()), - ] - .into(), + ], )) .await; } else { @@ -159,8 +155,7 @@ impl CommandExecutor for SoundExecutor { [ TextComponent::text(sound_name), TextComponent::text(players_who_heard.to_string()), - ] - .into(), + ], )) .await; } diff --git a/pumpkin/src/command/commands/seed.rs b/pumpkin/src/command/commands/seed.rs index da6c380db..15ae52761 100644 --- a/pumpkin/src/command/commands/seed.rs +++ b/pumpkin/src/command/commands/seed.rs @@ -43,11 +43,10 @@ impl CommandExecutor for PumpkinExecutor { [TextComponent::text(seed.clone()) .hover_event(HoverEvent::show_text(TextComponent::translate( Cow::from("chat.copy.click"), - vec![], + [], ))) .click_event(ClickEvent::CopyToClipboard(Cow::from(seed))) - .color_named(NamedColor::Green)] - .into(), + .color_named(NamedColor::Green)], )) .await; Ok(()) diff --git a/pumpkin/src/command/commands/setblock.rs b/pumpkin/src/command/commands/setblock.rs index 7d755424c..20f218734 100644 --- a/pumpkin/src/command/commands/setblock.rs +++ b/pumpkin/src/command/commands/setblock.rs @@ -75,11 +75,10 @@ impl CommandExecutor for SetblockExecutor { TextComponent::text(pos.0.x.to_string()), TextComponent::text(pos.0.y.to_string()), TextComponent::text(pos.0.z.to_string()), - ] - .into(), + ], ) } else { - TextComponent::translate("commands.setblock.failed", [].into()) + TextComponent::translate("commands.setblock.failed", []) }) .await; diff --git a/pumpkin/src/command/commands/stop.rs b/pumpkin/src/command/commands/stop.rs index f9dd143e3..994ae1e12 100644 --- a/pumpkin/src/command/commands/stop.rs +++ b/pumpkin/src/command/commands/stop.rs @@ -22,8 +22,7 @@ impl CommandExecutor for StopExecutor { ) -> Result<(), CommandError> { sender .send_message( - TextComponent::translate("commands.stop.stopping", [].into()) - .color_named(NamedColor::Red), + TextComponent::translate("commands.stop.stopping", []).color_named(NamedColor::Red), ) .await; diff --git a/pumpkin/src/command/commands/summon.rs b/pumpkin/src/command/commands/summon.rs index 65494918f..c6f5ca815 100644 --- a/pumpkin/src/command/commands/summon.rs +++ b/pumpkin/src/command/commands/summon.rs @@ -42,7 +42,7 @@ impl CommandExecutor for SummonExecutor { sender .send_message(TextComponent::translate( "commands.summon.success", - [TextComponent::text(format!("{entity:?}"))].into(), + [TextComponent::text(format!("{entity:?}"))], )) .await; } diff --git a/pumpkin/src/command/commands/teleport.rs b/pumpkin/src/command/commands/teleport.rs index c1d9170a9..c2e53fdae 100644 --- a/pumpkin/src/command/commands/teleport.rs +++ b/pumpkin/src/command/commands/teleport.rs @@ -195,10 +195,7 @@ impl CommandExecutor for TpSelfToEntityExecutor { } _ => { sender - .send_message(TextComponent::translate( - "permissions.requires.player", - [].into(), - )) + .send_message(TextComponent::translate("permissions.requires.player", [])) .await; } }; @@ -226,10 +223,7 @@ impl CommandExecutor for TpSelfToPosExecutor { } _ => { sender - .send_message(TextComponent::translate( - "permissions.requires.player", - [].into(), - )) + .send_message(TextComponent::translate("permissions.requires.player", [])) .await; } }; diff --git a/pumpkin/src/command/commands/time.rs b/pumpkin/src/command/commands/time.rs index f5a2d7fd4..e2e5b8658 100644 --- a/pumpkin/src/command/commands/time.rs +++ b/pumpkin/src/command/commands/time.rs @@ -67,21 +67,21 @@ impl CommandExecutor for TimeQueryExecutor { let curr_time = level_time.query_daytime(); TextComponent::translate( "commands.time.query", - [TextComponent::text(curr_time.to_string())].into(), + [TextComponent::text(curr_time.to_string())], ) } QueryMode::GameTime => { let curr_time = level_time.query_gametime(); TextComponent::translate( "commands.time.query", - [TextComponent::text(curr_time.to_string())].into(), + [TextComponent::text(curr_time.to_string())], ) } QueryMode::Day => { let curr_time = level_time.query_day(); TextComponent::translate( "commands.time.query", - [TextComponent::text(curr_time.to_string())].into(), + [TextComponent::text(curr_time.to_string())], ) } }; @@ -131,7 +131,7 @@ impl CommandExecutor for TimeChangeExecutor { let curr_time = level_time.query_daytime(); TextComponent::translate( "commands.time.add", - [TextComponent::text(curr_time.to_string())].into(), + [TextComponent::text(curr_time.to_string())], ) } Mode::Set(_) => { @@ -140,7 +140,7 @@ impl CommandExecutor for TimeChangeExecutor { level_time.send_time(world).await; TextComponent::translate( "commands.time.set", - [TextComponent::text(time_count.to_string())].into(), + [TextComponent::text(time_count.to_string())], ) } }; diff --git a/pumpkin/src/command/commands/title.rs b/pumpkin/src/command/commands/title.rs index b32433130..751410842 100644 --- a/pumpkin/src/command/commands/title.rs +++ b/pumpkin/src/command/commands/title.rs @@ -50,7 +50,7 @@ impl CommandExecutor for ClearOrResetExecutor { }; TextComponent::translate( text, - [TextComponent::text(targets[0].gameprofile.name.clone())].into(), + [TextComponent::text(targets[0].gameprofile.name.clone())], ) } else { let text = if reset { @@ -58,10 +58,7 @@ impl CommandExecutor for ClearOrResetExecutor { } else { "commands.title.cleared.multiple" }; - TextComponent::translate( - text, - [TextComponent::text(targets.len().to_string())].into(), - ) + TextComponent::translate(text, [TextComponent::text(targets.len().to_string())]) }) .await; @@ -96,12 +93,12 @@ impl CommandExecutor for TitleExecutor { .send_message(if targets.len() == 1 { TextComponent::translate( format!("commands.title.show.{mode_name}.single"), - [TextComponent::text(targets[0].gameprofile.name.clone())].into(), + [TextComponent::text(targets[0].gameprofile.name.clone())], ) } else { TextComponent::translate( format!("commands.title.show.{mode_name}.multiple"), - [TextComponent::text(targets.len().to_string())].into(), + [TextComponent::text(targets.len().to_string())], ) }) .await; diff --git a/pumpkin/src/command/commands/weather.rs b/pumpkin/src/command/commands/weather.rs index c6dc9d609..e66241852 100644 --- a/pumpkin/src/command/commands/weather.rs +++ b/pumpkin/src/command/commands/weather.rs @@ -43,10 +43,7 @@ impl CommandExecutor for WeatherExecutor { .set_weather_parameters(&world, duration, 0, false, false) .await; sender - .send_message(TextComponent::translate( - "commands.weather.set.clear", - [].into(), - )) + .send_message(TextComponent::translate("commands.weather.set.clear", [])) .await; } WeatherMode::Rain => { @@ -54,10 +51,7 @@ impl CommandExecutor for WeatherExecutor { .set_weather_parameters(&world, 0, duration, true, false) .await; sender - .send_message(TextComponent::translate( - "commands.weather.set.rain", - [].into(), - )) + .send_message(TextComponent::translate("commands.weather.set.rain", [])) .await; } WeatherMode::Thunder => { @@ -65,10 +59,7 @@ impl CommandExecutor for WeatherExecutor { .set_weather_parameters(&world, 0, duration, true, true) .await; sender - .send_message(TextComponent::translate( - "commands.weather.set.thunder", - [].into(), - )) + .send_message(TextComponent::translate("commands.weather.set.thunder", [])) .await; } } diff --git a/pumpkin/src/command/commands/worldborder.rs b/pumpkin/src/command/commands/worldborder.rs index 2b59a0550..9f454c67a 100644 --- a/pumpkin/src/command/commands/worldborder.rs +++ b/pumpkin/src/command/commands/worldborder.rs @@ -69,7 +69,7 @@ impl CommandExecutor for WorldborderGetExecutor { sender .send_message(TextComponent::translate( "commands.worldborder.get", - [TextComponent::text(diameter.to_string())].into(), + [TextComponent::text(diameter.to_string())], )) .await; Ok(()) @@ -109,7 +109,7 @@ impl CommandExecutor for WorldborderSetExecutor { if (distance - border.new_diameter).abs() < f64::EPSILON { sender .send_message( - TextComponent::translate(NOTHING_CHANGED_EXCEPTION, [].into()) + TextComponent::translate(NOTHING_CHANGED_EXCEPTION, []) .color(Color::Named(NamedColor::Red)), ) .await; @@ -120,7 +120,7 @@ impl CommandExecutor for WorldborderSetExecutor { sender .send_message(TextComponent::translate( "commands.worldborder.set.immediate", - [TextComponent::text(dist)].into(), + [TextComponent::text(dist)], )) .await; border.set_diameter(world, distance, None).await; @@ -174,7 +174,7 @@ impl CommandExecutor for WorldborderSetTimeExecutor { std::cmp::Ordering::Equal => { sender .send_message( - TextComponent::translate(NOTHING_CHANGED_EXCEPTION, [].into()) + TextComponent::translate(NOTHING_CHANGED_EXCEPTION, []) .color(Color::Named(NamedColor::Red)), ) .await; @@ -188,8 +188,7 @@ impl CommandExecutor for WorldborderSetTimeExecutor { [ TextComponent::text(dist), TextComponent::text(time.to_string()), - ] - .into(), + ], )) .await; } @@ -201,8 +200,7 @@ impl CommandExecutor for WorldborderSetTimeExecutor { [ TextComponent::text(dist), TextComponent::text(time.to_string()), - ] - .into(), + ], )) .await; } @@ -248,7 +246,7 @@ impl CommandExecutor for WorldborderAddExecutor { if distance == 0.0 { sender .send_message( - TextComponent::translate(NOTHING_CHANGED_EXCEPTION, [].into()) + TextComponent::translate(NOTHING_CHANGED_EXCEPTION, []) .color(Color::Named(NamedColor::Red)), ) .await; @@ -261,7 +259,7 @@ impl CommandExecutor for WorldborderAddExecutor { sender .send_message(TextComponent::translate( "commands.worldborder.set.immediate", - [TextComponent::text(dist)].into(), + [TextComponent::text(dist)], )) .await; border.set_diameter(world, distance, None).await; @@ -317,7 +315,7 @@ impl CommandExecutor for WorldborderAddTimeExecutor { std::cmp::Ordering::Equal => { sender .send_message( - TextComponent::translate(NOTHING_CHANGED_EXCEPTION, [].into()) + TextComponent::translate(NOTHING_CHANGED_EXCEPTION, []) .color(Color::Named(NamedColor::Red)), ) .await; @@ -331,8 +329,7 @@ impl CommandExecutor for WorldborderAddTimeExecutor { [ TextComponent::text(dist), TextComponent::text(time.to_string()), - ] - .into(), + ], )) .await; } @@ -344,8 +341,7 @@ impl CommandExecutor for WorldborderAddTimeExecutor { [ TextComponent::text(dist), TextComponent::text(time.to_string()), - ] - .into(), + ], )) .await; } @@ -383,8 +379,7 @@ impl CommandExecutor for WorldborderCenterExecutor { [ TextComponent::text(format!("{x:.2}")), TextComponent::text(format!("{z:.2}")), - ] - .into(), + ], )) .await; border.set_center(world, x, z).await; @@ -425,11 +420,8 @@ impl CommandExecutor for WorldborderDamageAmountExecutor { if (damage_per_block - border.damage_per_block).abs() < f32::EPSILON { sender .send_message( - TextComponent::translate( - "commands.worldborder.damage.amount.failed", - [].into(), - ) - .color(Color::Named(NamedColor::Red)), + TextComponent::translate("commands.worldborder.damage.amount.failed", []) + .color(Color::Named(NamedColor::Red)), ) .await; return Ok(()); @@ -439,7 +431,7 @@ impl CommandExecutor for WorldborderDamageAmountExecutor { sender .send_message(TextComponent::translate( "commands.worldborder.damage.amount.success", - [TextComponent::text(damage)].into(), + [TextComponent::text(damage)], )) .await; border.damage_per_block = damage_per_block; @@ -480,11 +472,8 @@ impl CommandExecutor for WorldborderDamageBufferExecutor { if (buffer - border.buffer).abs() < f32::EPSILON { sender .send_message( - TextComponent::translate( - "commands.worldborder.damage.buffer.failed", - [].into(), - ) - .color(Color::Named(NamedColor::Red)), + TextComponent::translate("commands.worldborder.damage.buffer.failed", []) + .color(Color::Named(NamedColor::Red)), ) .await; return Ok(()); @@ -494,7 +483,7 @@ impl CommandExecutor for WorldborderDamageBufferExecutor { sender .send_message(TextComponent::translate( "commands.worldborder.damage.buffer.success", - [TextComponent::text(buf)].into(), + [TextComponent::text(buf)], )) .await; border.buffer = buffer; @@ -535,11 +524,8 @@ impl CommandExecutor for WorldborderWarningDistanceExecutor { if distance == border.warning_blocks { sender .send_message( - TextComponent::translate( - "commands.worldborder.warning.distance.failed", - [].into(), - ) - .color(Color::Named(NamedColor::Red)), + TextComponent::translate("commands.worldborder.warning.distance.failed", []) + .color(Color::Named(NamedColor::Red)), ) .await; return Ok(()); @@ -548,7 +534,7 @@ impl CommandExecutor for WorldborderWarningDistanceExecutor { sender .send_message(TextComponent::translate( "commands.worldborder.warning.distance.success", - [TextComponent::text(distance.to_string())].into(), + [TextComponent::text(distance.to_string())], )) .await; border.set_warning_distance(world, distance).await; @@ -589,7 +575,7 @@ impl CommandExecutor for WorldborderWarningTimeExecutor { if time == border.warning_time { sender .send_message( - TextComponent::translate("commands.worldborder.warning.time.failed", [].into()) + TextComponent::translate("commands.worldborder.warning.time.failed", []) .color(Color::Named(NamedColor::Red)), ) .await; @@ -599,7 +585,7 @@ impl CommandExecutor for WorldborderWarningTimeExecutor { sender .send_message(TextComponent::translate( "commands.worldborder.warning.time.success", - [TextComponent::text(time.to_string())].into(), + [TextComponent::text(time.to_string())], )) .await; border.set_warning_delay(world, time).await; diff --git a/pumpkin/src/entity/living.rs b/pumpkin/src/entity/living.rs index 94026fa59..6267fed6c 100644 --- a/pumpkin/src/entity/living.rs +++ b/pumpkin/src/entity/living.rs @@ -55,7 +55,7 @@ impl LivingEntity { } } - pub async fn send_equipment_changes(&self, equipment: Vec<(EquipmentSlot, ItemStack)>) { + pub async fn send_equipment_changes(&self, equipment: &[(EquipmentSlot, ItemStack)]) { let equipment: Vec<(EquipmentSlot, Slot)> = equipment .iter() .map(|(slot, stack)| (*slot, Slot::from(stack))) diff --git a/pumpkin/src/entity/player.rs b/pumpkin/src/entity/player.rs index f3b375912..20ad028c4 100644 --- a/pumpkin/src/entity/player.rs +++ b/pumpkin/src/entity/player.rs @@ -504,7 +504,7 @@ impl Player { .wait_for_keep_alive .load(std::sync::atomic::Ordering::Relaxed) { - self.kick(TextComponent::translate("disconnect.timeout", [].into())) + self.kick(TextComponent::translate("disconnect.timeout", [])) .await; return; } diff --git a/pumpkin/src/net/mod.rs b/pumpkin/src/net/mod.rs index 3bb254ac2..541b8f536 100644 --- a/pumpkin/src/net/mod.rs +++ b/pumpkin/src/net/mod.rs @@ -552,15 +552,14 @@ impl Client { if let Some(entry) = banned_players.get_entry(profile) { let text = TextComponent::translate( "multiplayer.disconnect.banned.reason", - vec![TextComponent::text(entry.reason.clone())], + [TextComponent::text(entry.reason.clone())], ); return Some(match entry.expires { Some(expires) => text.add_child(TextComponent::translate( "multiplayer.disconnect.banned.expiration", [TextComponent::text( expires.format("%F at %T %Z").to_string(), - )] - .into(), + )], )), None => text, }); @@ -572,15 +571,14 @@ impl Client { if let Some(entry) = banned_ips.get_entry(&address.ip()) { let text = TextComponent::translate( "multiplayer.disconnect.banned_ip.reason", - vec![TextComponent::text(entry.reason.clone())], + [TextComponent::text(entry.reason.clone())], ); return Some(match entry.expires { Some(expires) => text.add_child(TextComponent::translate( "multiplayer.disconnect.banned_ip.expiration", [TextComponent::text( expires.format("%F at %T %Z").to_string(), - )] - .into(), + )], )), None => text, }); diff --git a/pumpkin/src/net/packet/handshake.rs b/pumpkin/src/net/packet/handshake.rs index 8d185c282..a49a4ed55 100644 --- a/pumpkin/src/net/packet/handshake.rs +++ b/pumpkin/src/net/packet/handshake.rs @@ -20,7 +20,7 @@ impl Client { std::cmp::Ordering::Less => { self.kick(&TextComponent::translate( "multiplayer.disconnect.outdated_client", - [TextComponent::text(CURRENT_MC_VERSION.to_string())].into(), + [TextComponent::text(CURRENT_MC_VERSION.to_string())], )) .await; } @@ -28,7 +28,7 @@ impl Client { std::cmp::Ordering::Greater => { self.kick(&TextComponent::translate( "multiplayer.disconnect.incompatible", - [TextComponent::text(CURRENT_MC_VERSION.to_string())].into(), + [TextComponent::text(CURRENT_MC_VERSION.to_string())], )) .await; } diff --git a/pumpkin/src/net/packet/login.rs b/pumpkin/src/net/packet/login.rs index 752e43e74..511a8e9c0 100644 --- a/pumpkin/src/net/packet/login.rs +++ b/pumpkin/src/net/packet/login.rs @@ -95,7 +95,7 @@ impl Client { if max_players > 0 && server.get_player_count().await >= max_players as usize { self.kick(&TextComponent::translate( "multiplayer.disconnect.server_full", - [].into(), + [], )) .await; return; @@ -189,13 +189,12 @@ impl Client { Ok(new_profile) => *profile = new_profile, Err(error) => { self.kick(&match error { - AuthError::FailedResponse => TextComponent::translate( - "multiplayer.disconnect.authservers_down", - [].into(), - ), + AuthError::FailedResponse => { + TextComponent::translate("multiplayer.disconnect.authservers_down", []) + } AuthError::UnverifiedUsername => TextComponent::translate( "multiplayer.disconnect.unverified_username", - [].into(), + [], ), e => TextComponent::text(e.to_string()), }) @@ -209,7 +208,7 @@ impl Client { log::debug!("Player (IP '{}', username '{}') tried to log in with the same UUID ('{}') as an online player (IP '{}', username '{}')", &self.address.lock().await, &profile.name, &profile.id, &online_player.client.address.lock().await, &online_player.gameprofile.name); self.kick(&TextComponent::translate( "multiplayer.disconnect.duplicate_login", - [].into(), + [], )) .await; return; @@ -220,7 +219,7 @@ impl Client { log::debug!("A player (IP '{}', attempted username '{}') tried to log in with the same username as an online player (UUID '{}', IP '{}', username '{}')", &self.address.lock().await, &profile.name, &profile.id, &online_player.client.address.lock().await, &online_player.gameprofile.name); self.kick(&TextComponent::translate( "multiplayer.disconnect.duplicate_login", - [].into(), + [], )) .await; return; diff --git a/pumpkin/src/net/packet/play.rs b/pumpkin/src/net/packet/play.rs index f8994a7a5..7013b0c1f 100644 --- a/pumpkin/src/net/packet/play.rs +++ b/pumpkin/src/net/packet/play.rs @@ -143,7 +143,7 @@ impl Player { if position.x.is_nan() || position.y.is_nan() || position.z.is_nan() { self.kick(TextComponent::translate( "multiplayer.disconnect.invalid_player_movement", - [].into(), + [], )) .await; return; @@ -232,7 +232,7 @@ impl Player { { self.kick(TextComponent::translate( "multiplayer.disconnect.invalid_player_movement", - [].into(), + [], )) .await; return; @@ -329,7 +329,7 @@ impl Player { if !rotation.yaw.is_finite() || !rotation.pitch.is_finite() { self.kick(TextComponent::translate( "multiplayer.disconnect.invalid_player_movement", - [].into(), + [], )) .await; return; @@ -483,7 +483,7 @@ impl Player { inventory.set_selected(dest_slot as u32); let empty = &ItemStack::new(0, Item::AIR); let stack = inventory.held_item().unwrap_or(empty); - let equipment = vec![(EquipmentSlot::MainHand, *stack)]; + let equipment = &[(EquipmentSlot::MainHand, *stack)]; self.living_entity.send_equipment_changes(equipment).await; self.client .send_packet(&CSetHeldItem::new(dest_slot as i8)) @@ -587,7 +587,7 @@ impl Player { if message.chars().any(|c| c == 'ยง' || c < ' ' || c == '\x7F') { self.kick(TextComponent::translate( "multiplayer.disconnect.illegal_characters", - [].into(), + [], )) .await; return; @@ -759,7 +759,7 @@ impl Player { // this can't be triggered from a non-modded client. self.kick(TextComponent::translate( "multiplayer.disconnect.invalid_entity_attacked", - [].into(), + [], )) .await; return; @@ -793,7 +793,7 @@ impl Player { ); self.kick(TextComponent::translate( "multiplayer.disconnect.invalid_entity_attacked", - [].into(), + [], )) .await; return; @@ -1141,7 +1141,7 @@ impl Player { inv.set_selected(slot as u32); let empty = &ItemStack::new(0, Item::AIR); let stack = inv.held_item().unwrap_or(empty); - let equipment = vec![(EquipmentSlot::MainHand, *stack)]; + let equipment = &[(EquipmentSlot::MainHand, *stack)]; self.living_entity.send_equipment_changes(equipment).await; } diff --git a/pumpkin/src/server/connection_cache.rs b/pumpkin/src/server/connection_cache.rs index 329cef19a..e9bac06bf 100644 --- a/pumpkin/src/server/connection_cache.rs +++ b/pumpkin/src/server/connection_cache.rs @@ -48,7 +48,7 @@ pub struct CachedStatus { pub struct CachedBranding { /// Cached Server brand buffer so we don't have to rebuild them every time a player joins - cached_server_brand: Vec, + cached_server_brand: Box<[u8]>, } impl CachedBranding { @@ -63,11 +63,11 @@ impl CachedBranding { } const BRAND: &str = "Pumpkin"; const BRAND_BYTES: &[u8] = Self::BRAND.as_bytes(); - fn build_brand() -> Vec { + fn build_brand() -> Box<[u8]> { let mut buf = Vec::new(); VarInt(Self::BRAND.len() as i32).encode(&mut buf); buf.extend_from_slice(Self::BRAND_BYTES); - buf + buf.into_boxed_slice() } } diff --git a/pumpkin/src/world/mod.rs b/pumpkin/src/world/mod.rs index 26868d8d7..ea652ef4c 100644 --- a/pumpkin/src/world/mod.rs +++ b/pumpkin/src/world/mod.rs @@ -884,7 +884,7 @@ impl World { tokio::spawn(async move { let msg_comp = TextComponent::translate( "multiplayer.player.joined", - [TextComponent::text(player.gameprofile.name.clone())].into(), + [TextComponent::text(player.gameprofile.name.clone())], ) .color_named(NamedColor::Yellow); let event = PlayerJoinEvent::new(player.clone(), msg_comp); @@ -943,7 +943,7 @@ impl World { if fire_event { let msg_comp = TextComponent::translate( "multiplayer.player.left", - [TextComponent::text(player.gameprofile.name.clone())].into(), + [TextComponent::text(player.gameprofile.name.clone())], ) .color_named(NamedColor::Yellow); let event = PlayerLeaveEvent::new(player.clone(), msg_comp);