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 } }