GenisysPro  for Minecraft PE/Windows 10 v1.1.x
Feature-rich server software for Minecraft PE and Windows 10 Edition
WaterPit Class Reference

Public Member Functions

 setRandomAmount ($amount)
 
 setBaseAmount ($amount)
 
 populate (ChunkManager $level, $chunkX, $chunkZ, Random $random)
 
- Public Member Functions inherited from Populator
 populate (ChunkManager $level, $chunkX, $chunkZ, Random $random)
 

Member Function Documentation

◆ populate()

populate ( ChunkManager  $level,
  $chunkX,
  $chunkZ,
Random  $random 
)
Parameters
ChunkManager$level
$chunkX
$chunkZ
Random$random
Returns
mixed|void
57  {
58  $this->level = $level;
59  $amount = $random->nextRange(0, $this->randomAmount + 1) + $this->baseAmount;
60  for($i = 0; $i < $amount; ++$i){
61  $x = $random->nextRange($chunkX * 16, $chunkX * 16 + 15);
62  $z = $random->nextRange($chunkZ * 16, $chunkZ * 16 + 15);
63  $y = $this->getHighestWorkableBlock($x, $z);
64 
65  if($y !== -1 and $this->canWaterPitStay($x, $y, $z)){
66  $this->level->setBlockIdAt($x, $y, $z, Block::STILL_WATER);
67  $this->level->setBlockDataAt($x, $y, $z, 8);
68  }
69  }
70  }

◆ setBaseAmount()

setBaseAmount (   $amount)
Parameters
$amount
45  {
46  $this->baseAmount = $amount;
47  }

◆ setRandomAmount()

setRandomAmount (   $amount)
Parameters
$amount
38  {
39  $this->randomAmount = $amount;
40  }

The documentation for this class was generated from the following file: