Skip to content

Commit

Permalink
- fix tall grass possibly preventing tree template features from placing
Browse files Browse the repository at this point in the history
- refined badlands terrain
- more lush birch forest grasses/flowers
  • Loading branch information
dags- committed Jun 14, 2020
1 parent 96704f5 commit 06ee44f
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

public abstract class TreePlacement extends AbstractTreeFeature<BaseTreeFeatureConfig> {

public static final Placement PLACEMENT = (world, pos) -> isDirtOrGrassBlock(world, pos.down()) && clearOverhead(world, pos);
public static final Placement PLACEMENT = (world, pos) -> isSoil(world, pos.down(), null) && clearOverhead(world, pos);

private TreePlacement() {
super(BaseTreeFeatureConfig::deserialize);
Expand All @@ -43,7 +43,8 @@ private static boolean clearOverhead(IWorld world, BlockPos pos) {
try (BlockPos.PooledMutable mutable = BlockPos.PooledMutable.retain()) {
int max = Math.min(world.getMaxHeight(), pos.getY() + 20);
for (int y = pos.getY(); y < max; y++) {
if (!isAirOrLeaves(world, mutable.setPos(pos.getX(), y, pos.getZ()))) {
mutable.setPos(pos.getX(), y, pos.getZ());
if (world.getBlockState(mutable).isSolid() && !isAirOrLeaves(world, mutable)) {
return false;
}
}
Expand Down

0 comments on commit 06ee44f

Please sign in to comment.