Fixing mineshaft going too up

This commit is contained in:
Adsooi 2017-05-14 19:44:11 +02:00
parent c7bbc37d8d
commit becff0ca47

View file

@ -80,7 +80,7 @@ class MineshaftPopulator extends AmountPopulator {
* @param Random $random * @param Random $random
*/ */
public function generateMineshaftPart(int $x, int $y, int $z, int $dir, Random $random) { public function generateMineshaftPart(int $x, int $y, int $z, int $dir, Random $random) {
if ($this->maxPath -- < 1) if ($this->maxPath -- < 1 || $y >= $level->getChunk(($x - ($x % 16)) / 16, ($z - ($z % 16)) / 16)->getHighestBlockAt($x % 16, $z % 16) - 10)
return; return;
$type = $random->nextBoundedInt(3); $type = $random->nextBoundedInt(3);
$level = $this->level; $level = $this->level;