valence_protocol/packets/play/
scoreboard_objective_update_s2c.rs
1use std::borrow::Cow;
2
3use bevy_ecs::prelude::*;
4use valence_text::Text;
5
6use crate::{Decode, Encode, Packet};
7
8#[derive(Clone, Debug, Encode, Decode, Packet)]
9pub struct ScoreboardObjectiveUpdateS2c<'a> {
10 pub objective_name: &'a str,
11 pub mode: ObjectiveMode<'a>,
12}
13
14#[derive(Clone, PartialEq, Debug, Encode, Decode)]
15pub enum ObjectiveMode<'a> {
16 Create {
17 objective_display_name: Cow<'a, Text>,
18 render_type: ObjectiveRenderType,
19 },
20 Remove,
21 Update {
22 objective_display_name: Cow<'a, Text>,
23 render_type: ObjectiveRenderType,
24 },
25}
26
27#[derive(Copy, Clone, PartialEq, Eq, Debug, Encode, Decode, Component, Default)]
28pub enum ObjectiveRenderType {
29 #[default]
31 Integer,
32 Hearts,
34}