Skip to content

Commit

Permalink
improv: tree
Browse files Browse the repository at this point in the history
  • Loading branch information
Zepalesque committed Jun 2, 2024
1 parent a8773d7 commit 7dbaa49
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,16 @@ protected boolean shouldSkipLocation(RandomSource rand, int x, int y, int z, int
// If the y offset is 0, only skip the location if it is on the corners, AND a boolean check succeeds
return x + z >= radius * 2 && rand.nextBoolean();
} else if (y == -1) {
// If the y offset is -1, skip the corners always, and skip stuff outside a diamond shape 75% of the time
boolean diamond = x + z <= radius;
return !diamond;
boolean square = x < radius && z < radius;
return !diamond || (!square && rand.nextFloat() < 0.75F);
} else if (y == -2) {
// If the y offset is -2, do not skip
return false;
// If the y offset is -2, skip the location if it is on the corners and an unlikely boolean check succeeds
return x + z >= radius * 2 && rand.nextFloat() < 0.25F;
} else {
// If the y offset is -3, skip the location if it is on the corners and a boolean check succeeds
return x + z >= radius * 2;
return x + z >= radius * 2 && rand.nextBoolean();
}
}

Expand Down

0 comments on commit 7dbaa49

Please sign in to comment.