Add Clientbound Display Objective
This commit is contained in:
1 parent
78391f20cd
commit
2a89150bfc
2 files changed
+45
No files matched your search
@@ -0,0 +1,43 @@
|
|||||||
|
use pumpkin_macros::packet;
|
||||||
|
use serde::Serialize;
|
||||||
|
|
||||||
|
use crate::VarInt;
|
||||||
|
|
||||||
|
#[derive(Serialize)]
|
||||||
|
#[packet(0x57)]
|
||||||
|
pub struct CDisplayObjective<'a> {
|
||||||
|
position: VarInt,
|
||||||
|
score_name: &'a str,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'a> CDisplayObjective<'a> {
|
||||||
|
pub fn new(position: DisplaySlot, score_name: &'a str) -> Self {
|
||||||
|
Self {
|
||||||
|
position: VarInt(position as i32),
|
||||||
|
score_name,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[repr(i32)]
|
||||||
|
pub enum DisplaySlot {
|
||||||
|
List,
|
||||||
|
Sidebar,
|
||||||
|
BelowName,
|
||||||
|
TeamBlack,
|
||||||
|
TeamDarkBlue,
|
||||||
|
TeamDarkGreen,
|
||||||
|
TeanDarkAqua,
|
||||||
|
TeamDarkRed,
|
||||||
|
TeamDarkPurple,
|
||||||
|
TeamGold,
|
||||||
|
TeamGray,
|
||||||
|
TeamDarkGray,
|
||||||
|
TeamBlue,
|
||||||
|
TeamGreen,
|
||||||
|
TeamAqua,
|
||||||
|
TeamRed,
|
||||||
|
TeamLightPurple,
|
||||||
|
TeamYellow,
|
||||||
|
TeamWhite,
|
||||||
|
}
|
||||||
@@ -7,6 +7,7 @@ mod c_change_difficulty;
|
|||||||
mod c_chunk_data;
|
mod c_chunk_data;
|
||||||
mod c_close_container;
|
mod c_close_container;
|
||||||
mod c_disguised_chat_message;
|
mod c_disguised_chat_message;
|
||||||
|
mod c_display_objective;
|
||||||
mod c_entity_animation;
|
mod c_entity_animation;
|
||||||
mod c_entity_metadata;
|
mod c_entity_metadata;
|
||||||
mod c_entity_status;
|
mod c_entity_status;
|
||||||
@@ -53,6 +54,7 @@ pub use c_change_difficulty::*;
|
|||||||
pub use c_chunk_data::*;
|
pub use c_chunk_data::*;
|
||||||
pub use c_close_container::*;
|
pub use c_close_container::*;
|
||||||
pub use c_disguised_chat_message::*;
|
pub use c_disguised_chat_message::*;
|
||||||
|
pub use c_display_objective::*;
|
||||||
pub use c_entity_animation::*;
|
pub use c_entity_animation::*;
|
||||||
pub use c_entity_metadata::*;
|
pub use c_entity_metadata::*;
|
||||||
pub use c_entity_status::*;
|
pub use c_entity_status::*;
|
||||||
|
|||||||
Reference in new issue
Block a user