diff options
| author | mat <git@matdoes.dev> | 2023-10-07 15:27:21 -0500 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2023-10-07 15:27:21 -0500 |
| commit | 5d075abfc5d09bd881095b09c16b38c1a27fbb23 (patch) | |
| tree | cbd8e40bb55b45523e0ce1596cf1d02f1fbe2b41 /azalea-world/src | |
| parent | 3831bd6f9cded2831a173c317832dd5f03617b38 (diff) | |
| download | azalea-drasl-5d075abfc5d09bd881095b09c16b38c1a27fbb23.tar.xz | |
make pathfinder twice as fast :sunglasses:
Diffstat (limited to 'azalea-world/src')
| -rwxr-xr-x | azalea-world/src/chunk_storage.rs | 1 | ||||
| -rwxr-xr-x | azalea-world/src/palette.rs | 2 |
2 files changed, 2 insertions, 1 deletions
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) |
