mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Fixed and silenced some inspections
This commit is contained in:
@ -22,6 +22,7 @@
|
||||
namespace pocketmine\level\generator\object;
|
||||
|
||||
use pocketmine\level\ChunkManager;
|
||||
use pocketmine\utils\Random;
|
||||
|
||||
class BigTree extends Tree{
|
||||
private $trunkHeightMultiplier = 0.618;
|
||||
@ -38,13 +39,13 @@ class BigTree extends Tree{
|
||||
private $addLogVines = false;
|
||||
private $addCocoaPlants = false;
|
||||
|
||||
public function canPlaceObject(ChunkManager $level, $x, $y, $z){
|
||||
public function canPlaceObject(ChunkManager $level, $x, $y, $z, Random $random){
|
||||
return false;
|
||||
}
|
||||
|
||||
public function placeObject(ChunkManager $level, $x, $y, $z, $type){
|
||||
public function placeObject(ChunkManager $level, $x, $y, $z, Random $random){
|
||||
|
||||
$this->trunkHeight = (int) ($this->totalHeight * $this->trunkHeightMultiplier);
|
||||
/*$this->trunkHeight = (int) ($this->totalHeight * $this->trunkHeightMultiplier);
|
||||
$leaves = $this->getLeafGroupPoints($level, $pos);
|
||||
foreach($leaves as $leafGroup){
|
||||
$groupX = $leafGroup->getBlockX();
|
||||
@ -54,7 +55,7 @@ class BigTree extends Tree{
|
||||
$this->generateGroupLayer($level, $groupX, $yy, $groupZ, $this->getLeafGroupLayerSize($yy - $groupY));
|
||||
}
|
||||
}
|
||||
/*final BlockIterator trunk = new BlockIterator(new Point(w, x, y - 1, z), new Point(w, x, y + trunkHeight, z));
|
||||
final BlockIterator trunk = new BlockIterator(new Point(w, x, y - 1, z), new Point(w, x, y + trunkHeight, z));
|
||||
while (trunk.hasNext()) {
|
||||
trunk.next().setMaterial(VanillaMaterials.LOG, logMetadata);
|
||||
}
|
||||
@ -69,13 +70,13 @@ class BigTree extends Tree{
|
||||
for($xx = -$xzRadius; $xx < ($xzRadius + 1); ++$xx){
|
||||
for($zz = -$xzRadius; $zz < ($xzRadius + 1); ++$zz){
|
||||
if((abs($xx) != $xzRadius or abs($zz) != $xzRadius) and $yRadius != 0){
|
||||
$level->setBlock($pos->x + $xx, $pos->y + $yy, $pos->z + $zz, 18, $type);
|
||||
$level->setBlock($pos->x + $xx, $pos->y + $yy, $pos->z + $zz, 18, $this->type);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for($yy = 0; $yy < ($this->totalHeight - 1); ++$yy){
|
||||
$level->setBlock($x, $pos->y + $yy, $z, 17, $type);
|
||||
$level->setBlock($x, $pos->y + $yy, $z, 17, $this->type);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
@ -36,6 +36,7 @@ class Pond{
|
||||
}
|
||||
|
||||
public function canPlaceObject(ChunkManager $level, Vector3 $pos){
|
||||
return false;
|
||||
}
|
||||
|
||||
public function placeObject(ChunkManager $level, Vector3 $pos){
|
||||
|
@ -23,6 +23,7 @@ namespace pocketmine\level\generator\populator;
|
||||
|
||||
use pocketmine\block\Water;
|
||||
use pocketmine\level\ChunkManager;
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\utils\Random;
|
||||
|
||||
class Pond extends Populator{
|
||||
@ -36,8 +37,8 @@ class Pond extends Populator{
|
||||
$y = $random->nextBoundedInt(128);
|
||||
$z = $random->nextRange($chunkZ << 4, ($chunkZ << 4) + 16);
|
||||
$pond = new \pocketmine\level\generator\object\Pond($random, new Water());
|
||||
if($pond->canPlaceObject($level, $x, $y, $z)){
|
||||
$pond->placeObject($level, $x, $y, $z);
|
||||
if($pond->canPlaceObject($level, $v = new Vector3($x, $y, $z))){
|
||||
$pond->placeObject($level, $v);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user