From 6ea5da408ae82165e7db9193fb340e2d2a3c4b14 Mon Sep 17 00:00:00 2001 From: Alexander Medvedev Date: Thu, 10 Jul 2025 10:22:30 +0200 Subject: [PATCH] Fix https://github.com/Pumpkin-MC/Pumpkin/issues/964 this was because of the light level not being checked, now there are too few mushrooms but i think still better --- .../src/generation/feature/features/random_patch.rs | 6 +++--- pumpkin/src/block/blocks/plant/mushroom_plant.rs | 9 +++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/pumpkin-world/src/generation/feature/features/random_patch.rs b/pumpkin-world/src/generation/feature/features/random_patch.rs index 5e96320ab..6d3ad3c4c 100644 --- a/pumpkin-world/src/generation/feature/features/random_patch.rs +++ b/pumpkin-world/src/generation/feature/features/random_patch.rs @@ -32,9 +32,9 @@ impl RandomPatchFeature { random: &mut RandomGenerator, pos: BlockPos, ) -> bool { - let mut i = 0; let xz = self.xz_spread as i32 + 1; let y = self.y_spread as i32 + 1; + let mut is_some = false; for _ in 0..self.tries { let pos = Vector3::new( pos.0.x + random.next_bounded_i32(xz) - random.next_bounded_i32(xz), @@ -55,8 +55,8 @@ impl RandomPatchFeature { { continue; } - i += 1; + is_some = true } - i > 0 + is_some } } diff --git a/pumpkin/src/block/blocks/plant/mushroom_plant.rs b/pumpkin/src/block/blocks/plant/mushroom_plant.rs index 73f344305..d8332783f 100644 --- a/pumpkin/src/block/blocks/plant/mushroom_plant.rs +++ b/pumpkin/src/block/blocks/plant/mushroom_plant.rs @@ -18,17 +18,14 @@ impl BlockMetadata for MushroomPlantBlock { #[async_trait] impl PumpkinBlock for MushroomPlantBlock { async fn can_place_at(&self, args: CanPlaceAtArgs<'_>) -> bool { - let (block_below, state) = args - .block_accessor - .get_block_and_block_state(&args.position.down()) - .await; + let block_below = args.block_accessor.get_block(&args.position.down()).await; if block_below .is_tagged_with("minecraft:mushroom_grow_block") .unwrap() { return true; } - // TODO - state.is_full_cube() + // TODO: Check light level and isOpaqueFullCube + false } }