Add ChatType

This commit is contained in:
Snowiiii committed 2024-08-12 15:46:24 +02:00
1 parent 65c2207c0a
commit 5cf19a4e98
16 files changed
+158 -151

No files matched your search

+2 -2
View File
@@ -66,8 +66,8 @@ impl Client {
let public_key_der = &server.public_key_der;
let packet = CEncryptionRequest::new(
"",
RawBytes(public_key_der),
RawBytes(&verify_token),
public_key_der,
&verify_token,
server.base_config.online_mode, // TODO
);
self.send_packet(packet);
+6 -4
View File
@@ -2,8 +2,8 @@ use num_traits::FromPrimitive;
use pumpkin_inventory::WindowType;
use pumpkin_protocol::{
client::play::{
Animation, CEntityAnimation, CHeadRot, COpenScreen, CPlayerChatMessage, CUpdateEntityPos,
CUpdateEntityPosRot, CUpdateEntityRot, FilterType,
Animation, CEntityAnimation, CHeadRot, COpenScreen, CUpdateEntityPos, CUpdateEntityPosRot,
CUpdateEntityRot,
},
server::play::{
SChatCommand, SChatMessage, SConfirmTeleport, SPlayerCommand, SPlayerPosition,
@@ -210,10 +210,10 @@ impl Client {
// false,
// ),
// );
server.broadcast_packet(
/* server.broadcast_packet(
self,
CPlayerChatMessage::new(
gameprofile.id,
pumpkin_protocol::uuid::UUID(gameprofile.id),
0.into(),
None,
message.clone(),
@@ -227,6 +227,8 @@ impl Client {
None,
),
)
*/
/* server.broadcast_packet(
self,
CDisguisedChatMessage::new(
+1 -1
View File
@@ -15,6 +15,6 @@ impl<'a> Command<'a> for PumpkinCommand {
fn on_execute(sender: &mut super::CommandSender<'a>, _command: String) {
let version = env!("CARGO_PKG_VERSION");
let description = env!("CARGO_PKG_DESCRIPTION");
sender.send_message(TextComponent::from(format!("Pumpkin {version}, {description} (Minecraft {CURRENT_MC_VERSION}, Protocol {CURRENT_MC_PROTOCOL})")).color_named(NamedColor::Green))
sender.send_message(TextComponent::from(format!("Pumpkin {version}, {description} (Minecraft {CURRENT_MC_VERSION}, Protocol {CURRENT_MC_PROTOCOL})")).color_named(NamedColor::Green).bold())
}
}
+2 -2
View File
@@ -233,7 +233,7 @@ impl Server {
// TODO: add velo
CSpawnEntity::new(
entity_id.into(),
gameprofile.id,
UUID(gameprofile.id),
EntityType::Player.to_i32().unwrap().into(),
x,
y,
@@ -256,7 +256,7 @@ impl Server {
let gameprofile = existing_client.gameprofile.as_ref().unwrap();
client.send_packet(CSpawnEntity::new(
player.entity_id().into(),
gameprofile.id,
UUID(gameprofile.id),
EntityType::Player.to_i32().unwrap().into(),
entity.x,
entity.y,