Skip to content

Commit eb0c0ed

Browse files
author
jmalek
committed
fix: Bad import + lints
1 parent 1cad8f9 commit eb0c0ed

5 files changed

Lines changed: 10 additions & 8 deletions

File tree

src/element_processing/landuse.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,13 @@ pub fn generate_landuse(
172172
if editor.check_for_block(x, 0, z, Some(&[GRASS_BLOCK])) {
173173
let random_choice: i32 = rng.random_range(0..30);
174174
if random_choice == 20 {
175-
let tree_type = match ground.level(XZPoint::new(x, z)) > crate::world_editor::CONIFERS_ONLY_ALTITUDE {
175+
let tree_type = match ground.level(XZPoint::new(x, z))
176+
> crate::world_editor::CONIFERS_ONLY_ALTITUDE
177+
{
176178
true => TreeType::Spruce,
177179
false => *trees_ok_to_generate
178-
.choose(&mut rng)
179-
.unwrap_or(&TreeType::Oak),
180+
.choose(&mut rng)
181+
.unwrap_or(&TreeType::Oak),
180182
};
181183
Tree::create_of_type(
182184
editor,

src/elevation_data.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ fn apply_gaussian_blur(heights: &[Vec<f64>], sigma: f64) -> Vec<Vec<f64>> {
637637
*val = match *val > THREEQRT_MAXY {
638638
false => sum / weight_sum,
639639
// For VERY high highs, *sharpen* peaks with the gaussian kernel instead!
640-
true => *val * 2. - (sum / weight_sum)
640+
true => *val * 2. - (sum / weight_sum),
641641
}
642642
}
643643
temp
@@ -667,7 +667,7 @@ fn apply_gaussian_blur(heights: &[Vec<f64>], sigma: f64) -> Vec<Vec<f64>> {
667667
*val = match *val > THREEQRT_MAXY {
668668
false => sum / weight_sum,
669669
// For VERY high highs, *sharpen* peaks with the gaussian kernel instead!
670-
true => *val * 2. - (sum / weight_sum)
670+
true => *val * 2. - (sum / weight_sum),
671671
}
672672
}
673673
blurred_column

src/ground_generation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ use crate::block_definitions::{
2323
};
2424
use crate::coordinate_system::cartesian::{XZBBox, XZPoint};
2525
use crate::element_processing::tree;
26+
use crate::elevation_data::MIN_Y;
2627
use crate::floodfill_cache::BuildingFootprintBitmap;
2728
use crate::ground::Ground;
2829
use crate::land_cover;
2930
use crate::progress::emit_gui_progress_update;
3031
use crate::world_editor::WorldEditor;
31-
use crate::world_editor::MIN_Y;
3232
use colored::Colorize;
3333
use indicatif::{ProgressBar, ProgressStyle};
3434
use rand::Rng;

src/world_editor/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
use crate::block_definitions::*;
77
// We need to use build height limits - the world will clip the geometry above the limit even if MC can index it in theory.
8-
use crate::elevation_data::{MIN_Y, MAX_Y};
8+
use crate::elevation_data::{MAX_Y, MIN_Y};
99
/// The rough altitude above which deciduous trees stop growing naturally.
1010
/// Can be overridden by explicit spec, but will be used to infer biome if it's not specified.
1111
pub(crate) const CONIFERS_ONLY_ALTITUDE: i32 = 3 * (MAX_Y - MIN_Y) / 2;

src/world_editor/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub mod bedrock;
1717

1818
// Re-export common types used internally
1919
pub(crate) use common::WorldToModify;
20-
pub(crate) use common::{CONIFERS_ONLY_ALTITUDE};
20+
pub(crate) use common::CONIFERS_ONLY_ALTITUDE;
2121

2222
#[cfg(feature = "bedrock")]
2323
pub(crate) use bedrock::{BedrockSaveError, BedrockWriter};

0 commit comments

Comments
 (0)