Changing private properties to protected

This is made to allow people to extend and use these properties.
This commit is contained in:
Ad5001 2017-05-14 19:23:44 +02:00
父節點 f0a43c5149
當前提交 015967050d
共有 9 個檔案被更改,包括 16 行新增16 行删除

查看文件

@ -21,16 +21,16 @@ use pocketmine\utils\Random;
class BetterBiomeSelector extends BiomeSelector {
/** @var Biome */
private $fallback;
protected $fallback;
/** @var Simplex */
private $temperature;
protected $temperature;
/** @var Simplex */
private $rainfall;
protected $rainfall;
/** @var Biome[] */
private $biomes = [ ];
private $lookup;
protected $biomes = [ ];
protected $lookup;
public function __construct(Random $random, callable $lookup, Biome $fallback) {
parent::__construct($random, $lookup, $fallback);
$this->fallback = $fallback;

查看文件

@ -73,7 +73,7 @@ class BetterNormal extends Generator {
public static $levels = [ ];
protected static $GAUSSIAN_KERNEL = null; // From main class
protected static $SMOOTH_SIZE = 2;
protected static $options = [
public static $options = [
"delBio" => [
],
"delStruct" => [
@ -81,7 +81,7 @@ class BetterNormal extends Generator {
]
];
protected $waterHeight = 63;
private $noiseBase;
protected $noiseBase;
/*
* Picks a biome by X and Z
@ -407,7 +407,7 @@ class BetterNormal extends Generator {
/*
* Generates the generation kernel based on smooth size (here 2)
*/
private static function generateKernel() {
protected static function generateKernel() {
self::$GAUSSIAN_KERNEL = [ ];
$bellSize = 1 / self::$SMOOTH_SIZE;

查看文件

@ -53,7 +53,7 @@ class DeadbushPopulator extends AmountPopulator {
* @param $z
* @return int
*/
private function getHighestWorkableBlock($x, $z){
protected function getHighestWorkableBlock($x, $z){
for($y = Level::Y_MAX - 1; $y > 0; --$y){
$b = $this->level->getBlockIdAt($x, $y, $z);
if($b === Block::DIRT or $b === Block::GRASS or $b === Block::SAND or $b === Block::SANDSTONE or $b === Block::HARDENED_CLAY or $b === Block::STAINED_HARDENED_CLAY){

查看文件

@ -66,7 +66,7 @@ class FallenTreePopulator extends AmountPopulator {
* @param $z
* @return int
*/
private function getHighestWorkableBlock($x, $z){
protected function getHighestWorkableBlock($x, $z){
for($y = Level::Y_MAX - 1; $y > 0; --$y){
$b = $this->level->getBlockIdAt($x, $y, $z);
if($b === Block::DIRT or $b === Block::GRASS){

查看文件

@ -41,7 +41,7 @@ class FloatingIslandPopulator extends AmountPopulator {
* @param $random pocketmine\utils\Random
*/
/** @var ChunkManager */
private $level;
protected $level;
public function populate(ChunkManager $level, $chunkX, $chunkZ, Random $random) {
$this->level = $level;

查看文件

@ -29,7 +29,7 @@ class Cactus extends Object {
* @param $z int
* @param $random pocketmine\utils\Random
*/
private $totalHeight;
protected $totalHeight;
public function canPlaceObject(ChunkManager $level, int $x, int $y, int $z, Random $random): bool {
$this->totalHeight = 1 + $random->nextBoundedInt(3);

查看文件

@ -39,7 +39,7 @@ class FallenTree extends Object {
protected $tree;
protected $direction;
protected $random;
private $length = 0;
protected $length = 0;
/*
* Constructs the class

查看文件

@ -30,7 +30,7 @@ class SugarCane extends Object {
* @param $z int
* @param $random pocketmine\utils\Random
*/
private $totalHeight;
protected $totalHeight;
public function canPlaceObject(ChunkManager $level, int $x, int $y, int $z, Random $random): bool {
$this->totalHeight = 1 + $random->nextBoundedInt(3);

查看文件

@ -108,8 +108,8 @@ class Temple extends Object {
]
];
/** @var ChunkManager */
private $level;
private $direction = 0;
protected $level;
protected $direction = 0;
/*
* Checks if a temple is placeable