Changing private properties to protected

This is made to allow people to extend and use these properties.
This commit is contained in:
Adsooi 2017-05-14 19:23:44 +02:00
parent f0a43c5149
commit 015967050d
9 changed files with 16 additions and 16 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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){

View file

@ -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){

View file

@ -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;

View file

@ -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);

View file

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

View file

@ -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);

View file

@ -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