diff --git a/pumpkin-protocol/src/client/play/c_chunk_data.rs b/pumpkin-protocol/src/client/play/c_chunk_data.rs index d225f14e..22d917b8 100644 --- a/pumpkin-protocol/src/client/play/c_chunk_data.rs +++ b/pumpkin-protocol/src/client/play/c_chunk_data.rs @@ -1,7 +1,6 @@ use std::collections::HashMap; use crate::{bytebuf::ByteBuffer, BitSet, ClientPacket, VarInt}; -use fastnbt::LongArray; use itertools::Itertools; use pumpkin_macros::packet; use pumpkin_world::{chunk::ChunkData, DIRECT_PALETTE_BITS}; diff --git a/pumpkin-protocol/src/client/play/c_chunk_data_update_light.rs b/pumpkin-protocol/src/client/play/c_chunk_data_update_light.rs deleted file mode 100644 index fb954c14..00000000 --- a/pumpkin-protocol/src/client/play/c_chunk_data_update_light.rs +++ /dev/null @@ -1,88 +0,0 @@ -use pumpkin_macros::packet; - -use crate::{bytebuf::ByteBuffer, BitSet, ClientPacket, VarInt, VarIntType}; - -#[packet(0x27)] -pub struct CChunkDataUpdateLight { - chunk_x: i32, - chunk_y: i32, - heightmaps: Vec, - data: Vec, - block_entites: Vec, - sky_light_mask: BitSet, - block_light_mask: BitSet, - empty_sky_light_mask: BitSet, - sky_lights: Vec, - block_lights: Vec, -} - -impl CChunkDataUpdateLight { - #[allow(clippy::too_many_arguments)] - pub fn new( - chunk_x: i32, - chunk_y: i32, - heightmaps: Vec, - data: Vec, - block_entites: Vec, - sky_light_mask: BitSet, - block_light_mask: BitSet, - empty_sky_light_mask: BitSet, - sky_lights: Vec, - block_lights: Vec, - ) -> Self { - Self { - chunk_x, - chunk_y, - heightmaps, - data, - block_entites, - sky_light_mask, - block_light_mask, - empty_sky_light_mask, - sky_lights, - block_lights, - } - } -} - -impl ClientPacket for CChunkDataUpdateLight { - fn write(&self, bytebuf: &mut ByteBuffer) { - bytebuf.put_i32(self.chunk_x); - bytebuf.put_i32(self.chunk_y); - bytebuf.put_slice(&self.heightmaps); - bytebuf.put_var_int(&(self.data.len() as VarIntType).into()); - bytebuf.put_slice(&self.data); - bytebuf.put_list::(&self.block_entites, |p, v| { - p.put_u8(v.packed_xz); - p.put_i16(v.y); - p.put_var_int(&v.typee); - p.put_slice(&v.data); - }); - bytebuf.put_bit_set(&self.sky_light_mask); - bytebuf.put_bit_set(&self.block_light_mask); - bytebuf.put_bit_set(&self.empty_sky_light_mask); - bytebuf.put_list::(&self.sky_lights, |p, v| { - p.put_var_int(&(v.array.len() as VarIntType).into()); - p.put_slice(&v.array); - }); - bytebuf.put_list::(&self.block_lights, |p, v| { - p.put_var_int(&(v.array.len() as VarIntType).into()); - p.put_slice(&v.array); - }); - } -} - -pub struct BlockEntity { - packed_xz: u8, - y: i16, - typee: VarInt, - data: Vec, -} - -pub struct SkyLight { - pub array: Vec, -} - -pub struct BlockLight { - pub array: Vec, -} diff --git a/pumpkin-protocol/src/client/play/mod.rs b/pumpkin-protocol/src/client/play/mod.rs index dd35343e..9bb6b286 100644 --- a/pumpkin-protocol/src/client/play/mod.rs +++ b/pumpkin-protocol/src/client/play/mod.rs @@ -2,7 +2,6 @@ mod c_actionbar; mod c_center_chunk; mod c_change_difficulty; mod c_chunk_data; -mod c_chunk_data_update_light; mod c_disguised_chat_message; mod c_entity_animation; mod c_entity_metadata; @@ -31,7 +30,6 @@ pub use c_actionbar::*; pub use c_center_chunk::*; pub use c_change_difficulty::*; pub use c_chunk_data::*; -pub use c_chunk_data_update_light::*; pub use c_disguised_chat_message::*; pub use c_entity_animation::*; pub use c_entity_metadata::*; diff --git a/pumpkin/src/server.rs b/pumpkin/src/server.rs index c3ba2f68..636f053d 100644 --- a/pumpkin/src/server.rs +++ b/pumpkin/src/server.rs @@ -17,9 +17,9 @@ use pumpkin_protocol::{ client::{ config::CPluginMessage, play::{ - CCenterChunk, CChunkData, CChunkDataUpdateLight, CGameEvent, CLogin, CPlayerAbilities, - CPlayerInfoUpdate, CRemoveEntities, CRemovePlayerInfo, CSetEntityMetadata, - CSpawnEntity, Metadata, PlayerAction, + CCenterChunk, CChunkData, CGameEvent, CLogin, CPlayerAbilities, CPlayerInfoUpdate, + CRemoveEntities, CRemovePlayerInfo, CSetEntityMetadata, CSpawnEntity, Metadata, + PlayerAction, }, }, uuid::UUID,