Skip to content

Commit

Permalink
chore: add summit threshold checker
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex4386 committed Dec 30, 2024
1 parent dfca08b commit 5b144a5
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1289,12 +1289,17 @@ public void addRootlessCone(Location location, int height, boolean openVent) {
int baseInt = (int) Math.ceil(baseRaw);

boolean allowLavaFlow = !this.isShuttingDown;
int summitThreshold = this.vent.getSummitBlock().getY() - 10;

// get circle around the base block
List<Block> craterBlock = VolcanoMath.getCircle(baseBlock, height);
double heightSum = 0;
for (Block block : craterBlock) {
Block highestBlock = TyphonUtils.getHighestRocklikes(block);
if (highestBlock.getY() + height > summitThreshold) {
return;
}

heightSum += highestBlock.getY();
}

Expand Down

0 comments on commit 5b144a5

Please sign in to comment.