From 5d075abfc5d09bd881095b09c16b38c1a27fbb23 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 7 Oct 2023 15:27:21 -0500 Subject: make pathfinder twice as fast :sunglasses: --- azalea-world/src/chunk_storage.rs | 1 + azalea-world/src/palette.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'azalea-world/src') diff --git a/azalea-world/src/chunk_storage.rs b/azalea-world/src/chunk_storage.rs index db4dd952..aad0f979 100755 --- a/azalea-world/src/chunk_storage.rs +++ b/azalea-world/src/chunk_storage.rs @@ -433,6 +433,7 @@ impl Default for ChunkStorage { /// Get the index of where a section is in a chunk based on its y coordinate /// and the minimum y coordinate of the world. +#[inline] pub fn section_index(y: i32, min_y: i32) -> u32 { assert!(y >= min_y, "y ({y}) must be at least {min_y}"); let min_section_index = min_y.div_floor(16); diff --git a/azalea-world/src/palette.rs b/azalea-world/src/palette.rs index 6e206062..5e57989c 100755 --- a/azalea-world/src/palette.rs +++ b/azalea-world/src/palette.rs @@ -86,7 +86,7 @@ impl PalettedContainer { /// of things in the storage. (So for block states, it must be less than /// 4096). pub fn get_at_index(&self, index: usize) -> u32 { - // first get the pallete id + // first get the palette id let paletted_value = self.storage.get(index); // and then get the value from that id self.palette.value_for(paletted_value as usize) -- cgit v1.2.3