mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-25 04:44:03 +00:00
level/generator: populate missing return type information
This commit is contained in:
parent
31e8efa6d1
commit
aa7d55e21d
@ -52,6 +52,9 @@ abstract class BiomeSelector{
|
|||||||
*/
|
*/
|
||||||
abstract protected function lookup(float $temperature, float $rainfall) : int;
|
abstract protected function lookup(float $temperature, float $rainfall) : int;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function recalculate(){
|
public function recalculate(){
|
||||||
$this->map = new \SplFixedArray(64 * 64);
|
$this->map = new \SplFixedArray(64 * 64);
|
||||||
|
|
||||||
|
@ -405,6 +405,8 @@ abstract class Noise{
|
|||||||
* @param float $x
|
* @param float $x
|
||||||
* @param float $y
|
* @param float $y
|
||||||
* @param float $z
|
* @param float $z
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setOffset($x, $y, $z){
|
public function setOffset($x, $y, $z){
|
||||||
$this->offsetX = $x;
|
$this->offsetX = $x;
|
||||||
|
@ -35,6 +35,15 @@ class BigTree extends Tree{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ChunkManager $level
|
||||||
|
* @param int $x
|
||||||
|
* @param int $y
|
||||||
|
* @param int $z
|
||||||
|
* @param Random $random
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function placeObject(ChunkManager $level, int $x, int $y, int $z, Random $random){
|
public function placeObject(ChunkManager $level, int $x, int $y, int $z, Random $random){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,15 @@ class BirchTree extends Tree{
|
|||||||
$this->superBirch = $superBirch;
|
$this->superBirch = $superBirch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ChunkManager $level
|
||||||
|
* @param int $x
|
||||||
|
* @param int $y
|
||||||
|
* @param int $z
|
||||||
|
* @param Random $random
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function placeObject(ChunkManager $level, int $x, int $y, int $z, Random $random){
|
public function placeObject(ChunkManager $level, int $x, int $y, int $z, Random $random){
|
||||||
$this->treeHeight = $random->nextBoundedInt(3) + 5;
|
$this->treeHeight = $random->nextBoundedInt(3) + 5;
|
||||||
if($this->superBirch){
|
if($this->superBirch){
|
||||||
|
@ -36,6 +36,15 @@ class OakTree extends Tree{
|
|||||||
$this->type = Wood::OAK;
|
$this->type = Wood::OAK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ChunkManager $level
|
||||||
|
* @param int $x
|
||||||
|
* @param int $y
|
||||||
|
* @param int $z
|
||||||
|
* @param Random $random
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function placeObject(ChunkManager $level, int $x, int $y, int $z, Random $random){
|
public function placeObject(ChunkManager $level, int $x, int $y, int $z, Random $random){
|
||||||
$this->treeHeight = $random->nextBoundedInt(3) + 4;
|
$this->treeHeight = $random->nextBoundedInt(3) + 4;
|
||||||
parent::placeObject($level, $x, $y, $z, $random);
|
parent::placeObject($level, $x, $y, $z, $random);
|
||||||
|
@ -49,6 +49,14 @@ class Ore{
|
|||||||
return $level->getBlockIdAt($x, $y, $z) === Block::STONE;
|
return $level->getBlockIdAt($x, $y, $z) === Block::STONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ChunkManager $level
|
||||||
|
* @param int $x
|
||||||
|
* @param int $y
|
||||||
|
* @param int $z
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function placeObject(ChunkManager $level, int $x, int $y, int $z){
|
public function placeObject(ChunkManager $level, int $x, int $y, int $z){
|
||||||
$clusterSize = $this->type->clusterSize;
|
$clusterSize = $this->type->clusterSize;
|
||||||
$angle = $this->random->nextFloat() * M_PI;
|
$angle = $this->random->nextFloat() * M_PI;
|
||||||
|
@ -43,6 +43,12 @@ class Pond{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ChunkManager $level
|
||||||
|
* @param Vector3 $pos
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function placeObject(ChunkManager $level, Vector3 $pos){
|
public function placeObject(ChunkManager $level, Vector3 $pos){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,15 @@ class SpruceTree extends Tree{
|
|||||||
$this->treeHeight = 10;
|
$this->treeHeight = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ChunkManager $level
|
||||||
|
* @param int $x
|
||||||
|
* @param int $y
|
||||||
|
* @param int $z
|
||||||
|
* @param Random $random
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function placeObject(ChunkManager $level, int $x, int $y, int $z, Random $random){
|
public function placeObject(ChunkManager $level, int $x, int $y, int $z, Random $random){
|
||||||
$this->treeHeight = $random->nextBoundedInt(4) + 6;
|
$this->treeHeight = $random->nextBoundedInt(4) + 6;
|
||||||
|
|
||||||
|
@ -31,6 +31,15 @@ use function count;
|
|||||||
|
|
||||||
class TallGrass{
|
class TallGrass{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ChunkManager $level
|
||||||
|
* @param Vector3 $pos
|
||||||
|
* @param Random $random
|
||||||
|
* @param int $count
|
||||||
|
* @param int $radius
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public static function growGrass(ChunkManager $level, Vector3 $pos, Random $random, int $count = 15, int $radius = 10){
|
public static function growGrass(ChunkManager $level, Vector3 $pos, Random $random, int $count = 15, int $radius = 10){
|
||||||
$arr = [
|
$arr = [
|
||||||
[Block::DANDELION, 0],
|
[Block::DANDELION, 0],
|
||||||
|
@ -49,6 +49,16 @@ abstract class Tree{
|
|||||||
/** @var int */
|
/** @var int */
|
||||||
public $treeHeight = 7;
|
public $treeHeight = 7;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ChunkManager $level
|
||||||
|
* @param int $x
|
||||||
|
* @param int $y
|
||||||
|
* @param int $z
|
||||||
|
* @param Random $random
|
||||||
|
* @param int $type
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public static function growTree(ChunkManager $level, int $x, int $y, int $z, Random $random, int $type = 0){
|
public static function growTree(ChunkManager $level, int $x, int $y, int $z, Random $random, int $type = 0){
|
||||||
switch($type){
|
switch($type){
|
||||||
case Sapling::SPRUCE:
|
case Sapling::SPRUCE:
|
||||||
@ -100,6 +110,15 @@ abstract class Tree{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ChunkManager $level
|
||||||
|
* @param int $x
|
||||||
|
* @param int $y
|
||||||
|
* @param int $z
|
||||||
|
* @param Random $random
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function placeObject(ChunkManager $level, int $x, int $y, int $z, Random $random){
|
public function placeObject(ChunkManager $level, int $x, int $y, int $z, Random $random){
|
||||||
|
|
||||||
$this->placeTrunk($level, $x, $y, $z, $random, $this->treeHeight - 1);
|
$this->placeTrunk($level, $x, $y, $z, $random, $this->treeHeight - 1);
|
||||||
@ -123,6 +142,16 @@ abstract class Tree{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ChunkManager $level
|
||||||
|
* @param int $x
|
||||||
|
* @param int $y
|
||||||
|
* @param int $z
|
||||||
|
* @param Random $random
|
||||||
|
* @param int $trunkHeight
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
protected function placeTrunk(ChunkManager $level, int $x, int $y, int $z, Random $random, int $trunkHeight){
|
protected function placeTrunk(ChunkManager $level, int $x, int $y, int $z, Random $random, int $trunkHeight){
|
||||||
// The base dirt block
|
// The base dirt block
|
||||||
$level->setBlockIdAt($x, $y - 1, $z, Block::DIRT);
|
$level->setBlockIdAt($x, $y - 1, $z, Block::DIRT);
|
||||||
|
@ -48,6 +48,8 @@ class Ore extends Populator{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param OreType[] $types
|
* @param OreType[] $types
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setOreTypes(array $types){
|
public function setOreTypes(array $types){
|
||||||
$this->oreTypes = $types;
|
$this->oreTypes = $types;
|
||||||
|
@ -49,14 +49,29 @@ class Pond extends Populator{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param int $waterOdd
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function setWaterOdd(int $waterOdd){
|
public function setWaterOdd(int $waterOdd){
|
||||||
$this->waterOdd = $waterOdd;
|
$this->waterOdd = $waterOdd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param int $lavaOdd
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function setLavaOdd(int $lavaOdd){
|
public function setLavaOdd(int $lavaOdd){
|
||||||
$this->lavaOdd = $lavaOdd;
|
$this->lavaOdd = $lavaOdd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param int $lavaSurfaceOdd
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function setLavaSurfaceOdd(int $lavaSurfaceOdd){
|
public function setLavaSurfaceOdd(int $lavaSurfaceOdd){
|
||||||
$this->lavaSurfaceOdd = $lavaSurfaceOdd;
|
$this->lavaSurfaceOdd = $lavaSurfaceOdd;
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,8 @@ class TallGrass extends Populator{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $amount
|
* @param int $amount
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setRandomAmount($amount){
|
public function setRandomAmount($amount){
|
||||||
$this->randomAmount = $amount;
|
$this->randomAmount = $amount;
|
||||||
@ -44,6 +46,8 @@ class TallGrass extends Populator{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $amount
|
* @param int $amount
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setBaseAmount($amount){
|
public function setBaseAmount($amount){
|
||||||
$this->baseAmount = $amount;
|
$this->baseAmount = $amount;
|
||||||
|
@ -49,6 +49,8 @@ class Tree extends Populator{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $amount
|
* @param int $amount
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setRandomAmount($amount){
|
public function setRandomAmount($amount){
|
||||||
$this->randomAmount = $amount;
|
$this->randomAmount = $amount;
|
||||||
@ -56,6 +58,8 @@ class Tree extends Populator{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $amount
|
* @param int $amount
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setBaseAmount($amount){
|
public function setBaseAmount($amount){
|
||||||
$this->baseAmount = $amount;
|
$this->baseAmount = $amount;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user