this was because of the light level not being checked, now there are too few mushrooms but i think still better
This commit is contained in:
1 parent
60d83022be
commit
6ea5da408a
2 files changed
+6
-9
No files matched your search
@@ -32,9 +32,9 @@ impl RandomPatchFeature {
|
|||||||
random: &mut RandomGenerator,
|
random: &mut RandomGenerator,
|
||||||
pos: BlockPos,
|
pos: BlockPos,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
let mut i = 0;
|
|
||||||
let xz = self.xz_spread as i32 + 1;
|
let xz = self.xz_spread as i32 + 1;
|
||||||
let y = self.y_spread as i32 + 1;
|
let y = self.y_spread as i32 + 1;
|
||||||
|
let mut is_some = false;
|
||||||
for _ in 0..self.tries {
|
for _ in 0..self.tries {
|
||||||
let pos = Vector3::new(
|
let pos = Vector3::new(
|
||||||
pos.0.x + random.next_bounded_i32(xz) - random.next_bounded_i32(xz),
|
pos.0.x + random.next_bounded_i32(xz) - random.next_bounded_i32(xz),
|
||||||
@@ -55,8 +55,8 @@ impl RandomPatchFeature {
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
i += 1;
|
is_some = true
|
||||||
}
|
}
|
||||||
i > 0
|
is_some
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -18,17 +18,14 @@ impl BlockMetadata for MushroomPlantBlock {
|
|||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl PumpkinBlock for MushroomPlantBlock {
|
impl PumpkinBlock for MushroomPlantBlock {
|
||||||
async fn can_place_at(&self, args: CanPlaceAtArgs<'_>) -> bool {
|
async fn can_place_at(&self, args: CanPlaceAtArgs<'_>) -> bool {
|
||||||
let (block_below, state) = args
|
let block_below = args.block_accessor.get_block(&args.position.down()).await;
|
||||||
.block_accessor
|
|
||||||
.get_block_and_block_state(&args.position.down())
|
|
||||||
.await;
|
|
||||||
if block_below
|
if block_below
|
||||||
.is_tagged_with("minecraft:mushroom_grow_block")
|
.is_tagged_with("minecraft:mushroom_grow_block")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// TODO
|
// TODO: Check light level and isOpaqueFullCube
|
||||||
state.is_full_cube()
|
false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user