aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src/packets/game
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-04-28 16:38:27 +0000
committermat <github@matdoes.dev>2022-04-28 16:38:27 +0000
commit1ca9caee36fb84e4a34be4d6b11399fcea8e8389 (patch)
tree7f9cd6c31dffb46451a2bfd7fbf5ce95acb53e39 /azalea-protocol/src/packets/game
parent64823e661f24fbd8e7807d02b6097c1e5ae9c3be (diff)
downloadazalea-drasl-1ca9caee36fb84e4a34be4d6b11399fcea8e8389.tar.xz
add bitset and work on chunk packets
Diffstat (limited to 'azalea-protocol/src/packets/game')
-rw-r--r--azalea-protocol/src/packets/game/clientbound_level_chunk_with_light_packet.rs21
-rw-r--r--azalea-protocol/src/packets/game/clientbound_light_update_packet.rs13
2 files changed, 30 insertions, 4 deletions
diff --git a/azalea-protocol/src/packets/game/clientbound_level_chunk_with_light_packet.rs b/azalea-protocol/src/packets/game/clientbound_level_chunk_with_light_packet.rs
index b90e8ff1..0dcb0ff2 100644
--- a/azalea-protocol/src/packets/game/clientbound_level_chunk_with_light_packet.rs
+++ b/azalea-protocol/src/packets/game/clientbound_level_chunk_with_light_packet.rs
@@ -1,5 +1,6 @@
-use azalea_core::{game_type::GameType, resource_location::ResourceLocation};
-use packet_macros::GamePacket;
+use packet_macros::{GamePacket, McBufReadable, McBufWritable};
+
+use super::clientbound_light_update_packet::ClientboundLightUpdatePacketData;
#[derive(Clone, Debug, GamePacket)]
pub struct ClientboundLevelChunkWithLightPacket {
@@ -9,4 +10,18 @@ pub struct ClientboundLevelChunkWithLightPacket {
pub light_data: ClientboundLightUpdatePacketData,
}
-pub struct ClientboundLevelChunkPacketData {}
+#[derive(Clone, Debug, McBufReadable, McBufWritable)]
+pub struct ClientboundLevelChunkPacketData {
+ heightmaps: azalea_nbt::Tag,
+ data: Vec<u8>,
+ block_entities: BlockEntity,
+}
+
+#[derive(Clone, Debug, McBufReadable, McBufWritable)]
+pub struct BlockEntity {
+ packed_xz: u8,
+ y: u16,
+ #[varint]
+ type_: i32,
+ data: azalea_nbt::Tag,
+}
diff --git a/azalea-protocol/src/packets/game/clientbound_light_update_packet.rs b/azalea-protocol/src/packets/game/clientbound_light_update_packet.rs
index 43d530e0..8e53e12e 100644
--- a/azalea-protocol/src/packets/game/clientbound_light_update_packet.rs
+++ b/azalea-protocol/src/packets/game/clientbound_light_update_packet.rs
@@ -1,3 +1,4 @@
+use crate::mc_buf::BitSet;
use azalea_core::{game_type::GameType, resource_location::ResourceLocation};
use packet_macros::GamePacket;
@@ -8,4 +9,14 @@ pub struct ClientboundLightUpdatePacket {
pub light_data: ClientboundLightUpdatePacketData,
}
-pub struct ClientboundLightUpdatePacketData {}
+#[derive(Clone, Debug, McBufReadable, McBufWritable)]
+pub struct ClientboundLightUpdatePacketData {
+ trust_edges: bool,
+ sky_y_mask: BitSet,
+ block_y_mask: BitSet,
+ empty_sky_y_mask: BitSet,
+ empty_block_y_mask: BitSet,
+ sky_updates: Vec<>,
+ block_updates: BitSet,
+
+}