Skip to content

Commit b681452

Browse files
committed
*actually* cargo fmt this time
1 parent b545389 commit b681452

3 files changed

Lines changed: 19 additions & 11 deletions

File tree

src/meloncraft_chat/src/title.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44
/// See the fields for more details.
55
#[derive(Debug, Clone)]
66
pub enum TitlePosition {
7-
87
/// Display the message in the middle of the screen.
98
/// Largest font size.
109
Title,
11-
10+
1211
/// Display the message just below where a [`TitlePosition::Title`] would be,
1312
/// in a smaller font size.
1413
///
@@ -25,7 +24,6 @@ pub enum TitlePosition {
2524
/// fade out.
2625
#[derive(Debug, Clone)]
2726
pub struct TitleTimings {
28-
2927
/// The number of ticks that it takes for any titles to fade *in* on the client's screen.
3028
pub fade_in_ticks: i32,
3129

@@ -35,4 +33,3 @@ pub struct TitleTimings {
3533
/// The number of ticks that it takes for any titles to fade *out* on the client's screen.
3634
pub fade_out_ticks: i32,
3735
}
38-

src/meloncraft_chat_broadcasting/src/send.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,3 @@ pub fn send_player_chat(
3434
});
3535
}
3636
}
37-

src/meloncraft_packet_forwarding/src/chat_message.rs

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ use bevy::ecs::message::{MessageReader, MessageWriter};
22
use meloncraft_chat::send::{ClearTitles, SendChatMessage, SendTitleMessage};
33
use meloncraft_chat::sent::PlayerSentChatMessage;
44
use meloncraft_chat::title::TitlePosition;
5-
use meloncraft_packets::{ClientboundClearTitles, ClientboundSetActionbarText, ClientboundSetSubtitleText, ClientboundSetTitleAnimationTimes, ClientboundSetTitleText, ClientboundSystemChat, ServerboundChat};
5+
use meloncraft_packets::{
6+
ClientboundClearTitles, ClientboundSetActionbarText, ClientboundSetSubtitleText,
7+
ClientboundSetTitleAnimationTimes, ClientboundSetTitleText, ClientboundSystemChat,
8+
ServerboundChat,
9+
};
610

711
pub fn fwd_player_sent(
812
mut chat_pr: MessageReader<ServerboundChat>,
@@ -42,7 +46,12 @@ pub fn fwd_send_title(
4246
for send_title in send_title_mr.read() {
4347
for receiver in send_title.receivers.clone() {
4448
if let Some(times) = &send_title.times {
45-
set_title_animation_times_pw.write(ClientboundSetTitleAnimationTimes { client: receiver, fade_in_ticks: times.fade_in_ticks, stay_ticks: times.stay_ticks, fade_out_ticks: times.fade_out_ticks });
49+
set_title_animation_times_pw.write(ClientboundSetTitleAnimationTimes {
50+
client: receiver,
51+
fade_in_ticks: times.fade_in_ticks,
52+
stay_ticks: times.stay_ticks,
53+
fade_out_ticks: times.fade_out_ticks,
54+
});
4655
}
4756

4857
match send_title.position {
@@ -51,19 +60,19 @@ pub fn fwd_send_title(
5160
client: receiver,
5261
title: send_title.message.clone(),
5362
});
54-
},
63+
}
5564
TitlePosition::Subtitle => {
5665
set_subtitle_text_pw.write(ClientboundSetSubtitleText {
5766
client: receiver,
5867
title: send_title.message.clone(),
5968
});
60-
},
69+
}
6170
TitlePosition::Actionbar => {
6271
set_actionbar_text_pw.write(ClientboundSetActionbarText {
6372
client: receiver,
6473
title: send_title.message.clone(),
6574
});
66-
},
75+
}
6776
}
6877
}
6978
}
@@ -76,7 +85,10 @@ pub fn fwd_clear_titles(
7685
for send_title in clear_title_mr.read() {
7786
for receiver in send_title.receivers.clone() {
7887
// for now, we always 'reset'.
79-
clear_titles_pw.write(ClientboundClearTitles { client: receiver, reset: true });
88+
clear_titles_pw.write(ClientboundClearTitles {
89+
client: receiver,
90+
reset: true,
91+
});
8092
}
8193
}
8294
}

0 commit comments

Comments
 (0)