aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-06-25 00:01:54 -0500
committermat <github@matdoes.dev>2022-06-25 00:01:54 -0500
commita0b3b793f9f631a85f243271531640f07490c4ca (patch)
tree6e861e0812343f3f6fdc03f44dd085a74b080dff
parent41f61bf9c11ab58af4c1bd97c2cb40110b272449 (diff)
downloadazalea-drasl-a0b3b793f9f631a85f243271531640f07490c4ca.tar.xz
ClientboundUpdateMobEffectPacket
-rw-r--r--azalea-client/src/client.rs3
-rw-r--r--azalea-protocol/src/packets/game/clientbound_update_mob_effect_packet.rs16
-rwxr-xr-xazalea-protocol/src/packets/game/mod.rs2
3 files changed, 21 insertions, 0 deletions
diff --git a/azalea-client/src/client.rs b/azalea-client/src/client.rs
index 364abef6..dfefe4ad 100644
--- a/azalea-client/src/client.rs
+++ b/azalea-client/src/client.rs
@@ -600,6 +600,9 @@ impl Client {
GamePacket::ClientboundSetEquipmentPacket(p) => {
println!("Got set equipment packet {:?}", p);
}
+ GamePacket::ClientboundUpdateMobEffectPacket(p) => {
+ println!("Got update mob effect packet {:?}", p);
+ }
_ => panic!("Unexpected packet {:?}", packet),
}
diff --git a/azalea-protocol/src/packets/game/clientbound_update_mob_effect_packet.rs b/azalea-protocol/src/packets/game/clientbound_update_mob_effect_packet.rs
new file mode 100644
index 00000000..5a446c2f
--- /dev/null
+++ b/azalea-protocol/src/packets/game/clientbound_update_mob_effect_packet.rs
@@ -0,0 +1,16 @@
+use azalea_buf::McBuf;
+use packet_macros::GamePacket;
+
+#[derive(Clone, Debug, McBuf, GamePacket)]
+pub struct ClientboundUpdateMobEffectPacket {
+ #[var]
+ pub entity_id: u32,
+ // TODO: have an enum for this
+ #[var]
+ pub effect: u32,
+ pub effect_amplifier: u8,
+ #[var]
+ pub effect_duration_ticks: u32,
+ pub flags: u8,
+ pub factor_data: Option<azalea_nbt::Tag>,
+}
diff --git a/azalea-protocol/src/packets/game/mod.rs b/azalea-protocol/src/packets/game/mod.rs
index 3e492dec..f407a697 100755
--- a/azalea-protocol/src/packets/game/mod.rs
+++ b/azalea-protocol/src/packets/game/mod.rs
@@ -46,6 +46,7 @@ pub mod clientbound_system_chat_packet;
pub mod clientbound_teleport_entity_packet;
pub mod clientbound_update_advancements_packet;
pub mod clientbound_update_attributes_packet;
+pub mod clientbound_update_mob_effect_packet;
pub mod clientbound_update_recipes_packet;
pub mod clientbound_update_tags_packet;
pub mod clientbound_update_view_distance_packet;
@@ -124,6 +125,7 @@ declare_state_packets!(
0x63: clientbound_teleport_entity_packet::ClientboundTeleportEntityPacket,
0x64: clientbound_update_advancements_packet::ClientboundUpdateAdvancementsPacket,
0x65: clientbound_update_attributes_packet::ClientboundUpdateAttributesPacket,
+ 0x66: clientbound_update_mob_effect_packet::ClientboundUpdateMobEffectPacket,
0x67: clientbound_update_recipes_packet::ClientboundUpdateRecipesPacket,
0x68: clientbound_update_tags_packet::ClientboundUpdateTagsPacket,
}