aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-05-26 19:12:19 -0500
committermat <github@matdoes.dev>2022-05-26 19:12:19 -0500
commit0c0fec00655fd5850e2123cb6fc2da94731dd409 (patch)
tree8b1e000486717e41d14100528ea200c2855fbe8f /azalea-protocol
parent7c302b4b2937496bee20f7b50cb31af6cc4b4eeb (diff)
downloadazalea-drasl-0c0fec00655fd5850e2123cb6fc2da94731dd409.tar.xz
fix some packets
Diffstat (limited to 'azalea-protocol')
-rwxr-xr-xazalea-protocol/packet-macros/src/lib.rs7
-rw-r--r--azalea-protocol/src/packets/game/clientbound_add_entity_packet.rs13
2 files changed, 9 insertions, 11 deletions
diff --git a/azalea-protocol/packet-macros/src/lib.rs b/azalea-protocol/packet-macros/src/lib.rs
index 927e783b..5ea69a62 100755
--- a/azalea-protocol/packet-macros/src/lib.rs
+++ b/azalea-protocol/packet-macros/src/lib.rs
@@ -354,7 +354,7 @@ pub fn declare_state_packets(input: TokenStream) -> TokenStream {
});
}
for PacketIdPair { id, module, name } in input.clientbound.packets {
- let name_litstr = syn::LitStr::new(&name.to_string(), name.span());
+ // let name_litstr = syn::LitStr::new(&name.to_string(), name.span());
enum_contents.extend(quote! {
#name(#module::#name),
});
@@ -365,10 +365,7 @@ pub fn declare_state_packets(input: TokenStream) -> TokenStream {
#state_name::#name(packet) => packet.write(buf),
});
clientbound_read_match_contents.extend(quote! {
- #id => {
- println!("reading packet {}", #name_litstr);
- #module::#name::read(buf)?
- },
+ #id => #module::#name::read(buf)?,
});
}
diff --git a/azalea-protocol/src/packets/game/clientbound_add_entity_packet.rs b/azalea-protocol/src/packets/game/clientbound_add_entity_packet.rs
index 9afd151b..8a8a713e 100644
--- a/azalea-protocol/src/packets/game/clientbound_add_entity_packet.rs
+++ b/azalea-protocol/src/packets/game/clientbound_add_entity_packet.rs
@@ -4,9 +4,9 @@ use uuid::Uuid;
#[derive(Clone, Debug, McBuf, GamePacket)]
pub struct ClientboundAddEntityPacket {
#[var]
- pub id: i32,
+ pub id: u32,
pub uuid: Uuid,
- // TODO: have an entity type struct
+ // TODO: have an entity type enum/struct
#[var]
pub entity_type: i32,
pub x: f64,
@@ -14,9 +14,10 @@ pub struct ClientboundAddEntityPacket {
pub z: f64,
pub x_rot: i8,
pub y_rot: i8,
- // pub y_head_rot: i8,
+ pub y_head_rot: i8,
+ #[var]
pub data: i32,
- pub x_vel: u16,
- pub y_vel: u16,
- pub z_vel: u16,
+ pub x_vel: i16,
+ pub y_vel: i16,
+ pub z_vel: i16,
}