Add text Titles
This commit is contained in:
parent
af912f3088
commit
41442c5b5d
15
pumpkin-protocol/src/client/play/c_actionbar.rs
Normal file
15
pumpkin-protocol/src/client/play/c_actionbar.rs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
use pumpkin_macros::packet;
|
||||||
|
use pumpkin_text::TextComponent;
|
||||||
|
use serde::Serialize;
|
||||||
|
|
||||||
|
#[derive(Serialize)]
|
||||||
|
#[packet(0x4C)]
|
||||||
|
pub struct CActionBar {
|
||||||
|
action_bar: TextComponent,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl CActionBar {
|
||||||
|
pub fn new(action_bar: TextComponent) -> Self {
|
||||||
|
Self { action_bar }
|
||||||
|
}
|
||||||
|
}
|
||||||
15
pumpkin-protocol/src/client/play/c_set_title.rs
Normal file
15
pumpkin-protocol/src/client/play/c_set_title.rs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
use pumpkin_macros::packet;
|
||||||
|
use pumpkin_text::TextComponent;
|
||||||
|
use serde::Serialize;
|
||||||
|
|
||||||
|
#[derive(Serialize)]
|
||||||
|
#[packet(0x65)]
|
||||||
|
pub struct CTitleText {
|
||||||
|
title: TextComponent,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl CTitleText {
|
||||||
|
pub fn new(title: TextComponent) -> Self {
|
||||||
|
Self { title }
|
||||||
|
}
|
||||||
|
}
|
||||||
15
pumpkin-protocol/src/client/play/c_subtitle.rs
Normal file
15
pumpkin-protocol/src/client/play/c_subtitle.rs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
use pumpkin_macros::packet;
|
||||||
|
use pumpkin_text::TextComponent;
|
||||||
|
use serde::Serialize;
|
||||||
|
|
||||||
|
#[derive(Serialize)]
|
||||||
|
#[packet(0x63)]
|
||||||
|
pub struct CSubtitle {
|
||||||
|
subtitle: TextComponent,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl CSubtitle {
|
||||||
|
pub fn new(subtitle: TextComponent) -> Self {
|
||||||
|
Self { subtitle }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,3 +1,4 @@
|
|||||||
|
mod c_actionbar;
|
||||||
mod c_change_difficulty;
|
mod c_change_difficulty;
|
||||||
mod c_chunk_data_update_light;
|
mod c_chunk_data_update_light;
|
||||||
mod c_disguised_chat_message;
|
mod c_disguised_chat_message;
|
||||||
@ -13,7 +14,9 @@ mod c_player_chat_message;
|
|||||||
mod c_player_info_update;
|
mod c_player_info_update;
|
||||||
mod c_remove_entities;
|
mod c_remove_entities;
|
||||||
mod c_set_held_item;
|
mod c_set_held_item;
|
||||||
|
mod c_set_title;
|
||||||
mod c_spawn_player;
|
mod c_spawn_player;
|
||||||
|
mod c_subtitle;
|
||||||
mod c_sync_player_position;
|
mod c_sync_player_position;
|
||||||
mod c_system_chat_message;
|
mod c_system_chat_message;
|
||||||
mod c_update_entitiy_pos_rot;
|
mod c_update_entitiy_pos_rot;
|
||||||
@ -21,6 +24,7 @@ mod c_update_entity_pos;
|
|||||||
mod c_update_entity_rot;
|
mod c_update_entity_rot;
|
||||||
mod player_action;
|
mod player_action;
|
||||||
|
|
||||||
|
pub use c_actionbar::*;
|
||||||
pub use c_change_difficulty::*;
|
pub use c_change_difficulty::*;
|
||||||
pub use c_chunk_data_update_light::*;
|
pub use c_chunk_data_update_light::*;
|
||||||
pub use c_disguised_chat_message::*;
|
pub use c_disguised_chat_message::*;
|
||||||
@ -36,7 +40,9 @@ pub use c_player_chat_message::*;
|
|||||||
pub use c_player_info_update::*;
|
pub use c_player_info_update::*;
|
||||||
pub use c_remove_entities::*;
|
pub use c_remove_entities::*;
|
||||||
pub use c_set_held_item::*;
|
pub use c_set_held_item::*;
|
||||||
|
pub use c_set_title::*;
|
||||||
pub use c_spawn_player::*;
|
pub use c_spawn_player::*;
|
||||||
|
pub use c_subtitle::*;
|
||||||
pub use c_sync_player_position::*;
|
pub use c_sync_player_position::*;
|
||||||
pub use c_system_chat_message::*;
|
pub use c_system_chat_message::*;
|
||||||
pub use c_update_entitiy_pos_rot::*;
|
pub use c_update_entitiy_pos_rot::*;
|
||||||
|
|||||||
@ -2,12 +2,6 @@ use super::Command;
|
|||||||
|
|
||||||
pub struct GamemodeCommand {}
|
pub struct GamemodeCommand {}
|
||||||
|
|
||||||
impl GamemodeCommand {
|
|
||||||
pub fn new() -> Self {
|
|
||||||
Self {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a> Command<'a> for GamemodeCommand {
|
impl<'a> Command<'a> for GamemodeCommand {
|
||||||
const NAME: &'a str = "gamemode";
|
const NAME: &'a str = "gamemode";
|
||||||
|
|
||||||
|
|||||||
@ -7,12 +7,6 @@ use super::Command;
|
|||||||
|
|
||||||
pub struct PumpkinCommand {}
|
pub struct PumpkinCommand {}
|
||||||
|
|
||||||
impl PumpkinCommand {
|
|
||||||
pub fn new() -> Self {
|
|
||||||
Self {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a> Command<'a> for PumpkinCommand {
|
impl<'a> Command<'a> for PumpkinCommand {
|
||||||
const NAME: &'a str = "pumpkin";
|
const NAME: &'a str = "pumpkin";
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user