Skip to content

Commit 4925bcd

Browse files
Fix inventory clear bug when selecting class (#615)
Fixes one of the issues of #613 Co-authored-by: Andrew Gazelka <andrew.gazelka@gmail.com>
1 parent 4578623 commit 4925bcd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

events/tag/src/command/class.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,18 @@ impl MinecraftCommand for ClassCommand {
4848
&mut Team,
4949
&mut Class,
5050
)>(|(stream, uuid, position, yaw, pitch, team, class)| {
51+
if *team == team_param && *class == class_param {
52+
let chat_pkt = agnostic::chat("§cYou’re already using this class!");
53+
54+
let mut bundle = DataBundle::new(compose);
55+
56+
bundle.add_packet(&chat_pkt, world).unwrap();
57+
58+
bundle.send(world, *stream, SystemId(0)).unwrap();
59+
60+
return;
61+
}
62+
5163
if *team != team_param {
5264
*team = team_param;
5365
caller.modified::<Team>();

0 commit comments

Comments
 (0)