@@ -13,6 +13,7 @@ use bytes::{Bytes, BytesMut};
1313use derive_more:: { Deref , DerefMut , From , Into } ;
1414use tracing:: warn;
1515use uuid:: Uuid ;
16+ use valence_bytes:: CowBytes ;
1617use valence_entity:: attributes:: { EntityAttributes , TrackedEntityAttributes } ;
1718use valence_entity:: living:: Health ;
1819use valence_entity:: player:: { Food , PlayerEntityBundle , Saturation } ;
@@ -33,15 +34,16 @@ use valence_protocol::packets::play::{
3334 ParticleS2c , PlaySoundS2c , UnloadChunkS2c ,
3435} ;
3536use valence_protocol:: profile:: Property ;
37+ use valence_protocol:: raw:: RawBytes ;
3638use valence_protocol:: sound:: { Sound , SoundCategory , SoundId } ;
3739use valence_protocol:: text:: { IntoText , Text } ;
3840use valence_protocol:: var_int:: VarInt ;
3941use valence_protocol:: { BlockPos , ChunkPos , Encode , GameMode , Packet } ;
4042use valence_registry:: RegistrySet ;
4143use valence_server_common:: { Despawned , UniqueId } ;
4244
43- use crate :: layer:: { ChunkLayer , EntityLayer , UpdateLayersPostClientSet , UpdateLayersPreClientSet } ;
4445use crate :: ChunkView ;
46+ use crate :: layer:: { ChunkLayer , EntityLayer , UpdateLayersPostClientSet , UpdateLayersPreClientSet } ;
4547
4648pub struct ClientPlugin ;
4749
@@ -445,12 +447,12 @@ pub struct Properties(pub Vec<Property>);
445447impl Properties {
446448 /// Finds the property with the name "textures".
447449 pub fn textures ( & self ) -> Option < & Property > {
448- self . 0 . iter ( ) . find ( |p| p. name == "textures" )
450+ self . 0 . iter ( ) . find ( |p| p. name == "textures" . into ( ) )
449451 }
450452
451453 /// Finds the property with the name "textures" mutably.
452454 pub fn textures_mut ( & mut self ) -> Option < & mut Property > {
453- self . 0 . iter_mut ( ) . find ( |p| p. name == "textures" )
455+ self . 0 . iter_mut ( ) . find ( |p| p. name == "textures" . into ( ) )
454456 }
455457
456458 /// Returns the value of the "textures" property. It's a base64-encoded
@@ -468,13 +470,13 @@ impl Properties {
468470 /// Mojang.
469471 pub fn set_skin ( & mut self , skin : impl Into < String > , signature : impl Into < String > ) {
470472 if let Some ( prop) = self . textures_mut ( ) {
471- prop. value = skin. into ( ) ;
472- prop. signature = Some ( signature. into ( ) ) ;
473+ prop. value = skin. into ( ) . into ( ) ;
474+ prop. signature = Some ( signature. into ( ) . into ( ) ) ;
473475 } else {
474476 self . 0 . push ( Property {
475- name : "textures" . to_owned ( ) ,
476- value : skin. into ( ) ,
477- signature : Some ( signature. into ( ) ) ,
477+ name : "textures" . into ( ) ,
478+ value : skin. into ( ) . into ( ) ,
479+ signature : Some ( signature. into ( ) . into ( ) ) ,
478480 } ) ;
479481 }
480482 }
@@ -1151,7 +1153,7 @@ fn init_tracked_data(mut clients: Query<(&mut Client, &TrackedData), Added<Track
11511153 if let Some ( init_data) = tracked_data. init_data ( ) {
11521154 client. write_packet ( & EntityTrackerUpdateS2c {
11531155 entity_id : VarInt ( 0 ) ,
1154- tracked_values : init_data . into ( ) ,
1156+ tracked_values : RawBytes ( CowBytes :: from ( init_data ) ) ,
11551157 } ) ;
11561158 }
11571159 }
@@ -1162,7 +1164,7 @@ fn update_tracked_data(mut clients: Query<(&mut Client, &TrackedData)>) {
11621164 if let Some ( update_data) = tracked_data. update_data ( ) {
11631165 client. write_packet ( & EntityTrackerUpdateS2c {
11641166 entity_id : VarInt ( 0 ) ,
1165- tracked_values : update_data . into ( ) ,
1167+ tracked_values : RawBytes ( CowBytes :: from ( update_data ) ) ,
11661168 } ) ;
11671169 }
11681170 }
0 commit comments