Fixing merge part 2.

This commit is contained in:
Adsooi 2017-05-13 17:03:39 +02:00
parent deef860af0
commit 32e07dea3f
4 changed files with 6 additions and 7 deletions

View file

@ -92,7 +92,7 @@ class CavePopulator extends AmountPopulator {
foreach($gen = $this->generateBranch($x, $y, $z, 5, 3, 5, $random ) as $v3 ) { foreach($gen = $this->generateBranch($x, $y, $z, 5, 3, 5, $random ) as $v3 ) {
$generatedBranches --; $generatedBranches --;
if ($generatedBranches <= 0) { if ($generatedBranches <= 0) {
$gen->send(self::STOP); // send not found.. @Ad5001 what is that $gen->send(self::STOP);
} else { } else {
$gen->send(self::CONTINUE); $gen->send(self::CONTINUE);
} }
@ -127,7 +127,6 @@ class CavePopulator extends AmountPopulator {
} }
$repeat = $random->nextBoundedInt(25 ) + 15; $repeat = $random->nextBoundedInt(25 ) + 15;
while($repeat -- > 0 ) { while($repeat -- > 0 ) {
// echo "Y => $y; H => $height; L => $length; D => $depth; R => $repeat" . PHP_EOL;
BuildingUtils::buildRandom($this->level, new Vector3($x, $y, $z ), new Vector3($length, $height, $depth ), $random, Block::get(Block::AIR )); BuildingUtils::buildRandom($this->level, new Vector3($x, $y, $z ), new Vector3($length, $height, $depth ), $random, Block::get(Block::AIR ));
$x += round(($random->nextBoundedInt(round(30 * ($length / 10) ) + 1 ) / 10 - 2)); $x += round(($random->nextBoundedInt(round(30 * ($length / 10) ) + 1 ) / 10 - 2));
$yP = $random->nextRange(- 14, 14); $yP = $random->nextRange(- 14, 14);

View file

@ -40,7 +40,7 @@ class DeadbushPopulator extends AmountPopulator {
$z = $random->nextRange($chunkZ * 16, $chunkZ * 16 + 15); $z = $random->nextRange($chunkZ * 16, $chunkZ * 16 + 15);
if(!in_array($level->getChunk($chunkX, $chunkZ)->getBiomeId(abs($x % 16), ($z % 16)), [40, 39, Biome::DESERT])) continue; if(!in_array($level->getChunk($chunkX, $chunkZ)->getBiomeId(abs($x % 16), ($z % 16)), [40, 39, Biome::DESERT])) continue;
$y = $this->getHighestWorkableBlock($x, $z); $y = $this->getHighestWorkableBlock($x, $z);
if ($y !== -1) { if ($y !== -1 && $level->getBlockIdAt($x, $y - 1, $z ) == Block::SAND) {
$level->setBlockIdAt($x, $y, $z, Block::DEAD_BUSH); $level->setBlockIdAt($x, $y, $z, Block::DEAD_BUSH);
$level->setBlockDataAt($x, $y, $z, 1); $level->setBlockDataAt($x, $y, $z, 1);
} }

View file

@ -23,7 +23,7 @@ use pocketmine\utils\Random;
class Well extends Object { class Well extends Object {
/** @var ChunkManager */ /** @var ChunkManager */
private $level; protected $level;
public $overridable = [ public $overridable = [
Block::AIR => true, Block::AIR => true,
6 => true, 6 => true,
@ -95,8 +95,8 @@ class Well extends Object {
$this->placeBlock($x + ($direction [0] * 2), $y, $z + ($direction [1] * 2), Block::SANDSTONE); $this->placeBlock($x + ($direction [0] * 2), $y, $z + ($direction [1] * 2), Block::SANDSTONE);
// Building slabs on the sides. Places two times due to all directions. // Building slabs on the sides. Places two times due to all directions.
$this->placeBlock($x + ($direction [0] * 2), $y, $z, Block::SANDSTONE, 1); $this->placeBlock($x + ($direction [0] * 2), $y, $z, 44, 1);
$this->placeBlock($x, $y, $z + ($direction [1] * 2), Block::SANDSTONE, 1); $this->placeBlock($x, $y, $z + ($direction [1] * 2), 44, 1);
// Placing water.Places two times due to all directions. // Placing water.Places two times due to all directions.
$this->placeBlock($x + $direction [0], $y, $z, Block::WATER); $this->placeBlock($x + $direction [0], $y, $z, Block::WATER);