Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in get_enclosing_parameters #641

Merged
merged 1 commit into from
Mar 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions pumpkin-world/src/biome/multi_noise.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,11 @@ fn get_batched_tree<T: Clone>(nodes: Vec<TreeNode<T>>) -> Vec<TreeNode<T>> {
fn get_enclosing_parameters<T: Clone>(nodes: &[TreeNode<T>]) -> [ParameterRange; 7] {
assert!(!nodes.is_empty(), "SubTree needs at least one child");
let mut bounds = *nodes[0].bounds();
for node in nodes {
for node in nodes.iter().skip(1) {
for (i, range) in node.bounds().iter().enumerate() {
bounds[i] = *range;
bounds[i] = bounds[i].combine(range);
}
}

bounds
}

Expand Down
2 changes: 1 addition & 1 deletion pumpkin-world/src/generation/aquifer_sampler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,6 @@ mod test {

use crate::{
block::ChunkBlockState,
chunk::CHUNK_WIDTH,
generation::{
GlobalRandomConfig, biome_coords,
chunk_noise::{
Expand Down Expand Up @@ -702,6 +701,7 @@ mod test {
FluidLevel::new(63, WATER_BLOCK),
FluidLevel::new(-54, LAVA_BLOCK),
));
const CHUNK_WIDTH: usize = 16;
let noise = ChunkNoiseGenerator::new(
base_router,
&RANDOM_CONFIG,
Expand Down
Loading