Skip to content

Commit 2daab99

Browse files
author
Andrew Gazelka
committed
update
1 parent 74d3200 commit 2daab99

File tree

18 files changed

+60
-55
lines changed

18 files changed

+60
-55
lines changed

vendor/valence/crates/valence_protocol/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ pub trait Encode {
196196
/// specialization is unavailable in stable Rust at the time of writing,
197197
/// we must make the slice specialization part of this trait.
198198
///
199-
/// [`write_all`]: Write:write_all
199+
/// [`write_all`]: std::io::Write::write_all
200200
fn encode_slice(slice: &[Self], mut w: impl Write) -> anyhow::Result<()>
201201
where
202202
Self: Sized,

vendor/valence/crates/valence_protocol/src/raw.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::{Bounded, DecodeBytes, Encode};
1414
/// slice. The input will be at the EOF state after this is decoded.
1515
///
1616
/// [encoding]: Encode
17-
/// [decoding]: Decode
17+
/// [decoding]: crate::DecodeBytes
1818
#[derive(
1919
Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Default, Debug, Deref, DerefMut, From, Into,
2020
)]

vendor/valence/crates/valence_server/src/abilities.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pub use valence_protocol::packets::play::player_abilities_s2c::PlayerAbilitiesFl
55
use valence_protocol::packets::play::{PlayerAbilitiesS2c, UpdatePlayerAbilitiesC2s};
66
use valence_protocol::{GameMode, WritePacket};
77

8-
use crate::client::{update_game_mode, Client, UpdateClientsSet};
8+
use crate::client::{Client, UpdateClientsSet, update_game_mode};
99
use crate::event_loop::{EventLoopPreUpdate, PacketEvent};
1010

1111
/// [`Component`] that stores the player's flying speed ability.

vendor/valence/crates/valence_server/src/brand.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use valence_bytes::CowUtf8Bytes;
1+
use valence_bytes::CowBytes;
22
use valence_protocol::packets::play::CustomPayloadS2c;
3-
use valence_protocol::{ident, Bounded, Encode, VarInt, WritePacket};
3+
use valence_protocol::raw::RawBytes;
4+
use valence_protocol::{Bounded, Encode, VarInt, WritePacket, ident};
45

56
pub trait SetBrand {
67
/// Sets the brand of the server.
@@ -23,7 +24,7 @@ impl<T: WritePacket> SetBrand for T {
2324
buf.extend_from_slice(brand.as_bytes());
2425
self.write_packet(&CustomPayloadS2c {
2526
channel: ident!("minecraft:brand"),
26-
data: Bounded(buf.into()),
27+
data: Bounded(RawBytes(CowBytes::from(buf))),
2728
});
2829
}
2930
}

vendor/valence/crates/valence_server/src/client.rs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use bytes::{Bytes, BytesMut};
1313
use derive_more::{Deref, DerefMut, From, Into};
1414
use tracing::warn;
1515
use uuid::Uuid;
16+
use valence_bytes::CowBytes;
1617
use valence_entity::attributes::{EntityAttributes, TrackedEntityAttributes};
1718
use valence_entity::living::Health;
1819
use valence_entity::player::{Food, PlayerEntityBundle, Saturation};
@@ -33,15 +34,16 @@ use valence_protocol::packets::play::{
3334
ParticleS2c, PlaySoundS2c, UnloadChunkS2c,
3435
};
3536
use valence_protocol::profile::Property;
37+
use valence_protocol::raw::RawBytes;
3638
use valence_protocol::sound::{Sound, SoundCategory, SoundId};
3739
use valence_protocol::text::{IntoText, Text};
3840
use valence_protocol::var_int::VarInt;
3941
use valence_protocol::{BlockPos, ChunkPos, Encode, GameMode, Packet};
4042
use valence_registry::RegistrySet;
4143
use valence_server_common::{Despawned, UniqueId};
4244

43-
use crate::layer::{ChunkLayer, EntityLayer, UpdateLayersPostClientSet, UpdateLayersPreClientSet};
4445
use crate::ChunkView;
46+
use crate::layer::{ChunkLayer, EntityLayer, UpdateLayersPostClientSet, UpdateLayersPreClientSet};
4547

4648
pub struct ClientPlugin;
4749

@@ -445,12 +447,12 @@ pub struct Properties(pub Vec<Property>);
445447
impl 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
}

vendor/valence/crates/valence_server/src/client_command.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use bevy_app::prelude::*;
22
use bevy_ecs::prelude::*;
33
use valence_entity::entity::Flags;
4-
use valence_entity::{entity, Pose};
5-
pub use valence_protocol::packets::play::client_command_c2s::ClientCommand;
4+
use valence_entity::{Pose, entity};
65
use valence_protocol::packets::play::ClientCommandC2s;
6+
pub use valence_protocol::packets::play::client_command_c2s::ClientCommand;
77

88
use crate::event_loop::{EventLoopPreUpdate, PacketEvent};
99

vendor/valence/crates/valence_server/src/client_settings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use bevy_app::prelude::*;
22
use bevy_ecs::prelude::*;
33
use valence_entity::player::{self, PlayerModelParts};
4-
use valence_protocol::packets::play::client_settings_c2s::ChatMode;
54
use valence_protocol::packets::play::ClientSettingsC2s;
5+
use valence_protocol::packets::play::client_settings_c2s::ChatMode;
66

77
use crate::client::ViewDistance;
88
use crate::event_loop::{EventLoopPreUpdate, PacketEvent};

vendor/valence/crates/valence_server/src/custom_payload.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
use bevy_app::prelude::*;
22
use bevy_ecs::prelude::*;
3+
use valence_bytes::CowBytes;
34
use valence_protocol::packets::play::{CustomPayloadC2s, CustomPayloadS2c};
5+
use valence_protocol::raw::RawBytes;
46
use valence_protocol::{Bounded, Ident, WritePacket};
57

68
use crate::client::Client;
@@ -26,7 +28,7 @@ impl Client {
2628
pub fn send_custom_payload(&mut self, channel: Ident, data: &[u8]) {
2729
self.write_packet(&CustomPayloadS2c {
2830
channel: channel.into(),
29-
data: Bounded(data.into()),
31+
data: Bounded(RawBytes(CowBytes::from(data))),
3032
});
3133
}
3234
}
@@ -40,7 +42,7 @@ fn handle_custom_payload(
4042
events.send(CustomPayloadEvent {
4143
client: packet.client,
4244
channel: pkt.channel.into(),
43-
data: pkt.data.0 .0.into(),
45+
data: pkt.data.0.0.into(),
4446
})
4547
}
4648
}

vendor/valence/crates/valence_server/src/event_loop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::time::Instant;
22

3-
use bevy_app::prelude::*;
43
use bevy_app::MainScheduleOrder;
4+
use bevy_app::prelude::*;
55
use bevy_ecs::prelude::*;
66
use bevy_ecs::schedule::ScheduleLabel;
77
use bevy_ecs::system::SystemState;

vendor/valence/crates/valence_server/src/hand_swing.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use bevy_app::prelude::*;
22
use bevy_ecs::prelude::*;
33
use valence_entity::{EntityAnimation, EntityAnimations};
4-
use valence_protocol::packets::play::HandSwingC2s;
54
use valence_protocol::Hand;
5+
use valence_protocol::packets::play::HandSwingC2s;
66

77
use crate::event_loop::{EventLoopPreUpdate, PacketEvent};
88

0 commit comments

Comments
 (0)