From d0505f7de30e4a9a330ef99d0082849ee44723e0 Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 2 Oct 2023 17:51:38 -0500 Subject: optimize pathfinder more --- azalea-world/src/chunk_storage.rs | 5 +++-- azalea-world/src/lib.rs | 6 ++---- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'azalea-world/src') diff --git a/azalea-world/src/chunk_storage.rs b/azalea-world/src/chunk_storage.rs index 2e93f2fb..ce611a61 100755 --- a/azalea-world/src/chunk_storage.rs +++ b/azalea-world/src/chunk_storage.rs @@ -7,6 +7,7 @@ use azalea_buf::{BufReadError, McBufReadable, McBufWritable}; use azalea_core::position::{BlockPos, ChunkBlockPos, ChunkPos, ChunkSectionBlockPos}; use azalea_nbt::NbtCompound; use log::{debug, trace, warn}; +use nohash_hasher::IntMap; use parking_lot::RwLock; use std::str::FromStr; use std::{ @@ -37,7 +38,7 @@ pub struct PartialChunkStorage { pub struct ChunkStorage { pub height: u32, pub min_y: i32, - pub map: HashMap>>, + pub map: IntMap>>, } /// A single chunk in a world (16*?*16 blocks). This only contains the blocks @@ -214,7 +215,7 @@ impl ChunkStorage { ChunkStorage { height, min_y, - map: HashMap::new(), + map: IntMap::default(), } } diff --git a/azalea-world/src/lib.rs b/azalea-world/src/lib.rs index 0d80f75d..55e47676 100644 --- a/azalea-world/src/lib.rs +++ b/azalea-world/src/lib.rs @@ -3,7 +3,7 @@ #![feature(error_generic_member_access)] mod bit_storage; -mod chunk_storage; +pub mod chunk_storage; mod container; pub mod heightmap; pub mod iterators; @@ -13,9 +13,7 @@ mod world; use std::backtrace::Backtrace; pub use bit_storage::BitStorage; -pub use chunk_storage::{ - calculate_chunk_storage_range, Chunk, ChunkStorage, PartialChunkStorage, Section, -}; +pub use chunk_storage::{Chunk, ChunkStorage, PartialChunkStorage, Section}; pub use container::*; use thiserror::Error; pub use world::*; -- cgit v1.2.3