@@ -8,15 +8,15 @@ use azalea_core::{
88 position:: { ChunkPos , Vec3 } ,
99} ;
1010use azalea_entity:: {
11- ActiveEffects , Dead , EntityBundle , EntityKindComponent , HasClientLoaded , LoadedBy , LocalEntity ,
12- LookDirection , Physics , PlayerAbilities , Position , RelativeEntityUpdate ,
1311 indexing:: { EntityIdIndex , EntityUuidIndex } ,
1412 inventory:: Inventory ,
15- metadata:: { Health , apply_metadata} ,
13+ metadata:: { apply_metadata, Health } ,
14+ ActiveEffects , Dead , EntityBundle , EntityKindComponent , HasClientLoaded , LoadedBy , LocalEntity ,
15+ LookDirection , Physics , PlayerAbilities , Position , RelativeEntityUpdate ,
1616} ;
1717use azalea_protocol:: {
1818 common:: movements:: MoveFlags ,
19- packets:: { ConnectionProtocol , game:: * } ,
19+ packets:: { game:: * , ConnectionProtocol } ,
2020} ;
2121use azalea_registry:: builtin:: EntityKind ;
2222use azalea_world:: { PartialWorld , WorldName , Worlds } ;
@@ -25,7 +25,6 @@ pub use events::*;
2525use tracing:: { debug, error, trace, warn} ;
2626
2727use crate :: {
28- ClientInformation ,
2928 block_update:: QueuedServerBlockUpdates ,
3029 chat:: { ChatPacket , ChatReceivedEvent } ,
3130 chunks,
@@ -34,11 +33,12 @@ use crate::{
3433 disconnect:: DisconnectEvent ,
3534 interact:: BlockStatePredictionHandler ,
3635 inventory:: { ClientsideCloseContainerEvent , MenuOpenedEvent , SetContainerContentEvent } ,
37- local_player:: { Hunger , LocalGameMode , TabList , WorldHolder } ,
36+ local_player:: { Experience , Hunger , LocalGameMode , TabList , WorldHolder } ,
3837 movement:: { KnockbackData , KnockbackEvent } ,
3938 packet:: { as_system, declare_packet_handlers} ,
4039 player:: { GameProfileComponent , PlayerInfo } ,
4140 tick_counter:: TicksConnected ,
41+ ClientInformation ,
4242} ;
4343
4444pub fn process_packet ( ecs : & mut World , player : Entity , packet : & ClientboundGamePacket ) {
@@ -781,6 +781,13 @@ impl GamePacketHandler<'_> {
781781
782782 pub fn set_experience ( & mut self , p : & ClientboundSetExperience ) {
783783 debug ! ( "Got set experience packet {p:?}" ) ;
784+
785+ as_system :: < Query < & mut Experience > > ( self . ecs , |mut query| {
786+ let mut experience = query. get_mut ( self . player ) . unwrap ( ) ;
787+ experience. progress = p. experience_progress ;
788+ experience. level = p. experience_level ;
789+ experience. total = p. total_experience ;
790+ } ) ;
784791 }
785792
786793 pub fn teleport_entity ( & mut self , p : & ClientboundTeleportEntity ) {
0 commit comments