aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-05-07 22:03:49 -0500
committermat <github@matdoes.dev>2022-05-07 22:03:49 -0500
commita60c1ac05bf8f7e815d550d0a0ea1b091d9ea865 (patch)
tree62d47e33aed0a37f5f30288a754eec09d6a1df79 /azalea-protocol/src
parentff79c1838add53ecf10e9e2783cdcaba122f1650 (diff)
downloadazalea-drasl-a60c1ac05bf8f7e815d550d0a0ea1b091d9ea865.tar.xz
block update packet
Diffstat (limited to 'azalea-protocol/src')
-rw-r--r--azalea-protocol/src/packets/game/clientbound_block_update_packet.rs12
-rwxr-xr-xazalea-protocol/src/packets/game/mod.rs6
2 files changed, 16 insertions, 2 deletions
diff --git a/azalea-protocol/src/packets/game/clientbound_block_update_packet.rs b/azalea-protocol/src/packets/game/clientbound_block_update_packet.rs
new file mode 100644
index 00000000..575b7f46
--- /dev/null
+++ b/azalea-protocol/src/packets/game/clientbound_block_update_packet.rs
@@ -0,0 +1,12 @@
+use azalea_core::BlockPos;
+use packet_macros::GamePacket;
+
+#[derive(Clone, Debug, GamePacket)]
+pub struct ClientboundBlockUpdatePacket {
+ pub pos: BlockPos,
+ // TODO: in vanilla this is a BlockState, but here we just have it as a number.
+ // however, we can't add azalea-world as a dependency because it depends on us.
+ // we could have a crate that contains encoding/decoding and the definitions?
+ #[var]
+ pub block_state: u32,
+}
diff --git a/azalea-protocol/src/packets/game/mod.rs b/azalea-protocol/src/packets/game/mod.rs
index c9000913..64818638 100755
--- a/azalea-protocol/src/packets/game/mod.rs
+++ b/azalea-protocol/src/packets/game/mod.rs
@@ -1,7 +1,7 @@
-pub mod clientbound_level_event_packet;
pub mod clientbound_add_entity_packet;
pub mod clientbound_add_mob_packet;
pub mod clientbound_add_player_packet;
+pub mod clientbound_block_update_packet;
pub mod clientbound_change_difficulty_packet;
pub mod clientbound_chat_packet;
pub mod clientbound_container_set_content_packet;
@@ -13,6 +13,7 @@ pub mod clientbound_entity_velocity_packet;
pub mod clientbound_initialize_border_packet;
pub mod clientbound_keep_alive_packet;
pub mod clientbound_level_chunk_with_light_packet;
+pub mod clientbound_level_event_packet;
pub mod clientbound_light_update_packet;
pub mod clientbound_login_packet;
pub mod clientbound_move_entity_pos_packet;
@@ -54,6 +55,7 @@ declare_state_packets!(
0x00: clientbound_add_entity_packet::ClientboundAddEntityPacket,
0x02: clientbound_add_mob_packet::ClientboundAddMobPacket,
0x04: clientbound_add_player_packet::ClientboundAddPlayerPacket,
+ 0xc: clientbound_block_update_packet::ClientboundBlockUpdatePacket,
0x0e: clientbound_change_difficulty_packet::ClientboundChangeDifficultyPacket,
0xf: clientbound_chat_packet::ClientboundChatPacket,
0x12: clientbound_declare_commands_packet::ClientboundDeclareCommandsPacket,
@@ -93,4 +95,4 @@ declare_state_packets!(
0x66: clientbound_update_recipes_packet::ClientboundUpdateRecipesPacket,
0x67: clientbound_update_tags_packet::ClientboundUpdateTagsPacket,
}
-); \ No newline at end of file
+);