Browse Source

Fixing merge part 2.

pull/22/merge
Ad5001 3 years ago
parent
commit
32e07dea3f
4 changed files with 6 additions and 7 deletions
  1. +1
    -1
      src/Ad5001/BetterGen/generator/BetterNormal.php
  2. +1
    -2
      src/Ad5001/BetterGen/populator/CavePopulator.php
  3. +1
    -1
      src/Ad5001/BetterGen/populator/DeadbushPopulator.php
  4. +3
    -3
      src/Ad5001/BetterGen/structure/Well.php

+ 1
- 1
src/Ad5001/BetterGen/generator/BetterNormal.php View File

@@ -258,7 +258,7 @@ class BetterNormal extends Generator {
if (is_string($ret )) {
$ret = new $ret ();
}
return $ret;
return $ret;
}
/*


+ 1
- 2
src/Ad5001/BetterGen/populator/CavePopulator.php View File

@@ -92,7 +92,7 @@ class CavePopulator extends AmountPopulator {
foreach($gen = $this->generateBranch($x, $y, $z, 5, 3, 5, $random ) as $v3 ) {
$generatedBranches --;
if ($generatedBranches <= 0) {
$gen->send(self::STOP); // send not found.. @Ad5001 what is that
$gen->send(self::STOP);
} else {
$gen->send(self::CONTINUE);
}
@@ -127,7 +127,6 @@ class CavePopulator extends AmountPopulator {
}
$repeat = $random->nextBoundedInt(25 ) + 15;
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 ));
$x += round(($random->nextBoundedInt(round(30 * ($length / 10) ) + 1 ) / 10 - 2));
$yP = $random->nextRange(- 14, 14);


+ 1
- 1
src/Ad5001/BetterGen/populator/DeadbushPopulator.php View File

@@ -40,7 +40,7 @@ class DeadbushPopulator extends AmountPopulator {
$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;
$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->setBlockDataAt($x, $y, $z, 1);
}


+ 3
- 3
src/Ad5001/BetterGen/structure/Well.php View File

@@ -23,7 +23,7 @@ use pocketmine\utils\Random;

class Well extends Object {
/** @var ChunkManager */
private $level;
protected $level;
public $overridable = [
Block::AIR => true,
6 => true,
@@ -95,8 +95,8 @@ class Well extends Object {
$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.
$this->placeBlock($x + ($direction [0] * 2), $y, $z, Block::SANDSTONE, 1);
$this->placeBlock($x, $y, $z + ($direction [1] * 2), Block::SANDSTONE, 1);
$this->placeBlock($x + ($direction [0] * 2), $y, $z, 44, 1);
$this->placeBlock($x, $y, $z + ($direction [1] * 2), 44, 1);
// Placing water.Places two times due to all directions.
$this->placeBlock($x + $direction [0], $y, $z, Block::WATER);


Loading…
Cancel
Save