From df9d776ff8e3945ce7d367e6cecb54957ee0fd7a Mon Sep 17 00:00:00 2001 From: Kumpelinus Date: Mon, 21 Jul 2025 22:28:41 +0200 Subject: Add TicksAlive component (#229) * Add TicksAlive component * Rename TicksAlive to TicksConnected * Move component to plugins/tick_counter.rs and add doc comment --- azalea-client/src/plugins/packet/game/mod.rs | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'azalea-client/src/plugins/packet') diff --git a/azalea-client/src/plugins/packet/game/mod.rs b/azalea-client/src/plugins/packet/game/mod.rs index fd6b712c..b7886208 100644 --- a/azalea-client/src/plugins/packet/game/mod.rs +++ b/azalea-client/src/plugins/packet/game/mod.rs @@ -22,22 +22,9 @@ pub use events::*; use tracing::{debug, error, trace, warn}; use crate::{ - ClientInformation, - block_update::QueuedServerBlockUpdates, - chat::{ChatPacket, ChatReceivedEvent}, - chunks, - connection::RawConnection, - declare_packet_handlers, - disconnect::DisconnectEvent, - interact::BlockStatePredictionHandler, - inventory::{ + block_update::QueuedServerBlockUpdates, chat::{ChatPacket, ChatReceivedEvent}, chunks, connection::RawConnection, declare_packet_handlers, disconnect::DisconnectEvent, interact::BlockStatePredictionHandler, inventory::{ ClientSideCloseContainerEvent, Inventory, MenuOpenedEvent, SetContainerContentEvent, - }, - loading::HasClientLoaded, - local_player::{Hunger, InstanceHolder, LocalGameMode, PlayerAbilities, TabList}, - movement::{KnockbackEvent, KnockbackType}, - packet::as_system, - player::{GameProfileComponent, PlayerInfo}, + }, loading::HasClientLoaded, local_player::{Hunger, InstanceHolder, LocalGameMode, PlayerAbilities, TabList}, movement::{KnockbackEvent, KnockbackType}, packet::as_system, player::{GameProfileComponent, PlayerInfo}, tick_counter::TicksConnected, ClientInformation }; pub fn process_packet(ecs: &mut World, player: Entity, packet: &ClientboundGamePacket) { @@ -299,6 +286,7 @@ impl GamePacketHandler<'_> { previous: p.common.previous_game_type.into(), }, entity_bundle, + TicksConnected(0), )); azalea_entity::indexing::add_entity_to_indexes( -- cgit v1.2.3