Skip to content

Commit 19041c5

Browse files
committed
log more debug info when resizing chunk palettes
1 parent 5ef9ab9 commit 19041c5

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

azalea-client/src/plugins/chat_signing.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pub struct RequestCertsTask(pub Task<Result<Certificates, FetchCertificatesError
3939
///
4040
/// This is used to avoid spamming requests if requesting certs fails. Usually,
4141
/// we just check [`Certificates::expires_at`].
42-
#[derive(Component)]
42+
#[derive(Component, Debug)]
4343
pub struct OnlyRefreshCertsAfter {
4444
pub refresh_at: Instant,
4545
}

azalea-world/src/bit_storage.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,10 @@ impl BitStorage {
206206
}
207207

208208
debug_assert!(index < self.size);
209-
debug_assert!(value <= self.mask);
209+
debug_assert!(
210+
value <= self.mask,
211+
"value {value} at {index} was outside of the mask for {self:?}"
212+
);
210213
let cell_index = self.cell_index(index as u64);
211214
let cell = &mut self.data[cell_index];
212215
let bit_index = (index - cell_index * self.values_per_long) * self.bits;

azalea-world/src/palette/container.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use azalea_block::BlockState;
77
use azalea_buf::{AzaleaRead, AzaleaWrite, BufReadError};
88
use azalea_core::position::{ChunkSectionBiomePos, ChunkSectionBlockPos};
99
use azalea_registry::Biome;
10-
use tracing::warn;
10+
use tracing::{debug, warn};
1111

1212
use super::{Palette, PaletteKind};
1313
use crate::BitStorage;
@@ -231,6 +231,10 @@ impl<S: PalletedContainerKind> PalettedContainer<S> {
231231
}
232232

233233
fn on_resize(&mut self, bits_per_entry: u8, value: S) -> usize {
234+
debug!(
235+
"Resizing PalettedContainer from {} bpe to {bits_per_entry} for {value:?} with palette={:?}",
236+
self.bits_per_entry, self.palette
237+
);
234238
// in vanilla this is always true, but it's sometimes false in purpur servers
235239
// assert!(bits_per_entry <= 5, "bits_per_entry must be <= 5");
236240
let mut new_data = self.create_or_reuse_data(bits_per_entry);

0 commit comments

Comments
 (0)