From 82c04004dbf37b813e1f4223d56b399c40d68e80 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 8 Oct 2022 00:03:07 -0500 Subject: change definition of Event::Tick --- azalea-client/src/client.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'azalea-client/src') diff --git a/azalea-client/src/client.rs b/azalea-client/src/client.rs index bbf78ee6..0e13415c 100644 --- a/azalea-client/src/client.rs +++ b/azalea-client/src/client.rs @@ -50,7 +50,7 @@ use tokio::{ pub enum Event { Login, Chat(ChatPacket), - /// A game tick, happens 20 times per second. + /// Happens 20 times per second, but only when the world is loaded. Tick, Packet(Box), } @@ -725,8 +725,6 @@ impl Client { /// Runs every 50 milliseconds. async fn game_tick(client: &mut Client, tx: &UnboundedSender) { - tx.send(Event::Tick).unwrap(); - // return if there's no chunk at the player's position { let dimension_lock = client.dimension.lock(); @@ -743,6 +741,8 @@ impl Client { } } + tx.send(Event::Tick).unwrap(); + // TODO: if we're a passenger, send the required packets if let Err(e) = client.send_position().await { -- cgit v1.2.3