diff options
| author | Kumpelinus <kumpelinus@jat.de> | 2025-07-21 22:28:41 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-21 15:28:41 -0500 |
| commit | df9d776ff8e3945ce7d367e6cecb54957ee0fd7a (patch) | |
| tree | aa72f41953fb05e69b660b092d13ecd76e77c1bd /azalea-client/src/plugins/packet/game | |
| parent | ebc2e0c067d8b2c901ae02e032159e2c80eac7bc (diff) | |
| download | azalea-drasl-df9d776ff8e3945ce7d367e6cecb54957ee0fd7a.tar.xz | |
Add TicksAlive component (#229)
* Add TicksAlive component
* Rename TicksAlive to TicksConnected
* Move component to plugins/tick_counter.rs and add doc comment
Diffstat (limited to 'azalea-client/src/plugins/packet/game')
| -rw-r--r-- | azalea-client/src/plugins/packet/game/mod.rs | 18 |
1 files changed, 3 insertions, 15 deletions
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( |
