Skip to content

Commit

Permalink
fix typo in method name
Browse files Browse the repository at this point in the history
  • Loading branch information
Luk-ESC committed Aug 21, 2024
1 parent f920f31 commit f38613c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pumpkin/src/client/player_packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ impl Client {
};
let player = self.player.as_mut().unwrap();
let id = player.entity_id();
server.broadcast_packet_expect(
server.broadcast_packet_except(
&[&self.token],
&CEntityAnimation::new(id.into(), animation as u8),
)
Expand Down Expand Up @@ -305,7 +305,7 @@ impl Client {
let packet = &CHurtAnimation::new(&entity_id, attacker_player.entity.yaw);
self.send_packet(packet);
client.send_packet(packet);
server.broadcast_packet_expect(
server.broadcast_packet_except(
&[self.token.as_ref(), token.as_ref()],
&CHurtAnimation::new(&entity_id, 10.0),
)
Expand Down
9 changes: 5 additions & 4 deletions pumpkin/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ impl Server {
if client.is_player() {
let id = client.player.as_ref().unwrap().entity_id();
let uuid = client.gameprofile.as_ref().unwrap().id;
self.broadcast_packet_expect(
self.broadcast_packet_except(
&[&client.token],
&CRemovePlayerInfo::new(1.into(), &[UUID(uuid)]),
);
self.broadcast_packet_expect(&[&client.token], &CRemoveEntities::new(&[id.into()]))
self.broadcast_packet_except(&[&client.token], &CRemoveEntities::new(&[id.into()]))
}
}

Expand Down Expand Up @@ -241,7 +241,7 @@ impl Server {
let gameprofile = client.gameprofile.as_ref().unwrap();

// spawn player for every client
self.broadcast_packet_expect(
self.broadcast_packet_except(
&[&client.token],
// TODO: add velo
&CSpawnEntity::new(
Expand Down Expand Up @@ -327,7 +327,8 @@ impl Server {
}
}

pub fn broadcast_packet_expect<P>(&self, from: &[&Token], packet: &P)
/// Sends a packet to all players except those specified in `from`
pub fn broadcast_packet_except<P>(&self, from: &[&Token], packet: &P)
where
P: ClientPacket,
{
Expand Down

0 comments on commit f38613c

Please sign in to comment.