Remove debugging again

This commit is contained in:
ice_iix 2022-01-01 09:13:35 -08:00
parent 5a07b9f18d
commit 43a47bc9df
2 changed files with 1 additions and 19 deletions

View File

@ -1970,7 +1970,6 @@ impl Server {
&mut self,
chunk_data: packet::play::clientbound::ChunkData_AndLight,
) {
println!("on_chunk_data_and_light chunk_data = {:?}", chunk_data);
self.world
.load_chunk117(
chunk_data.chunk_x,

View File

@ -1020,11 +1020,6 @@ impl World {
use byteorder::ReadBytesExt;
use std::io::Cursor;
println!(
"load_chunk19_to_117 x={:?} z={:?}, new={:?} mask={:?} num_sections={:?} data={:?}",
x, z, new, mask, num_sections, data
);
let mut data = Cursor::new(data);
let cpos = CPos(x, z);
@ -1052,12 +1047,10 @@ impl World {
if self.protocol_version >= 451 {
let _block_count = data.read_u16::<byteorder::LittleEndian>()?;
println!("_block_count = {:?}", _block_count);
// TODO: use block_count
}
let mut bit_size = data.read_u8()?;
println!("bit_size = {:?}", bit_size);
let mut mappings: HashMap<usize, block::Block, BuildHasherDefault<FNVHash>> =
HashMap::with_hasher(BuildHasherDefault::default());
let mut single_value: Option<usize> = None;
@ -1065,7 +1058,6 @@ impl World {
if self.protocol_version >= 757 {
// Single-valued palette
single_value = Some(VarInt::read_from(&mut data)?.0.try_into().unwrap());
println!("single_value = {:?}", single_value);
} else {
bit_size = 13;
}
@ -1086,14 +1078,11 @@ impl World {
}
let bits = LenPrefixed::<VarInt, u64>::read_from(&mut data)?.data;
println!("bits = {:?}", bits);
let padded = self.protocol_version >= 736;
let m = bit::Map::from_raw(bits, bit_size as usize, padded);
println!("m = {:?}", m);
for bi in 0..4096 {
let id = single_value.unwrap_or_else(|| m.get(bi));
println!("bi={:?} id={:?}", bi, id);
section.blocks.set(
bi,
mappings
@ -1126,19 +1115,15 @@ impl World {
if self.protocol_version >= 757 {
// Biomes palette TODO: refactor with block states, "palette container"
let _bit_size = data.read_u8()?;
println!("biome bit_size={:?}", _bit_size);
if _bit_size == 0 {
// Single-valued palette
// Single-valued palette
let _single_value = VarInt::read_from(&mut data)?.0;
println!("biome single_value = {:?}", _single_value);
} else {
// TODO: handle direct palettes, bit_size >= 4 for biomes
let count = VarInt::read_from(&mut data)?.0;
println!("biome palette length={:?}", count);
for _i in 0..count {
let _id = VarInt::read_from(&mut data)?.0;
println!("biome palette array {:?} = {:?}", i, _id);
//let bl = self
// .id_map
// .by_vanilla_id(id as usize, &self.modded_block_ids);
@ -1146,8 +1131,6 @@ impl World {
}
}
let _bits = LenPrefixed::<VarInt, u64>::read_from(&mut data)?.data;
println!("biome bits len={:?}", _bits.len());
println!("biome bits={:?}", _bits);
} else if self.protocol_version >= 451 {
// Skylight in update skylight packet for 1.14+
} else {