aboutsummaryrefslogtreecommitdiff
path: root/azalea-world/src
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2023-10-02 17:51:38 -0500
committermat <git@matdoes.dev>2023-10-02 17:51:38 -0500
commitd0505f7de30e4a9a330ef99d0082849ee44723e0 (patch)
treef91879b0423eb0329efd2cb12a10a4e98b3b366d /azalea-world/src
parentc3d27487cae6af5d593193b922d1e81e93a1c45d (diff)
downloadazalea-drasl-d0505f7de30e4a9a330ef99d0082849ee44723e0.tar.xz
optimize pathfinder more
Diffstat (limited to 'azalea-world/src')
-rwxr-xr-xazalea-world/src/chunk_storage.rs5
-rw-r--r--azalea-world/src/lib.rs6
2 files changed, 5 insertions, 6 deletions
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<ChunkPos, Weak<RwLock<Chunk>>>,
+ pub map: IntMap<ChunkPos, Weak<RwLock<Chunk>>>,
}
/// 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::*;