Changing private properties to protected
This is made to allow people to extend and use these properties.
This commit is contained in:
parent
f0a43c5149
commit
015967050d
9 changed files with 16 additions and 16 deletions
|
@ -21,16 +21,16 @@ use pocketmine\utils\Random;
|
||||||
class BetterBiomeSelector extends BiomeSelector {
|
class BetterBiomeSelector extends BiomeSelector {
|
||||||
|
|
||||||
/** @var Biome */
|
/** @var Biome */
|
||||||
private $fallback;
|
protected $fallback;
|
||||||
|
|
||||||
/** @var Simplex */
|
/** @var Simplex */
|
||||||
private $temperature;
|
protected $temperature;
|
||||||
/** @var Simplex */
|
/** @var Simplex */
|
||||||
private $rainfall;
|
protected $rainfall;
|
||||||
|
|
||||||
/** @var Biome[] */
|
/** @var Biome[] */
|
||||||
private $biomes = [ ];
|
protected $biomes = [ ];
|
||||||
private $lookup;
|
protected $lookup;
|
||||||
public function __construct(Random $random, callable $lookup, Biome $fallback) {
|
public function __construct(Random $random, callable $lookup, Biome $fallback) {
|
||||||
parent::__construct($random, $lookup, $fallback);
|
parent::__construct($random, $lookup, $fallback);
|
||||||
$this->fallback = $fallback;
|
$this->fallback = $fallback;
|
||||||
|
|
|
@ -73,7 +73,7 @@ class BetterNormal extends Generator {
|
||||||
public static $levels = [ ];
|
public static $levels = [ ];
|
||||||
protected static $GAUSSIAN_KERNEL = null; // From main class
|
protected static $GAUSSIAN_KERNEL = null; // From main class
|
||||||
protected static $SMOOTH_SIZE = 2;
|
protected static $SMOOTH_SIZE = 2;
|
||||||
protected static $options = [
|
public static $options = [
|
||||||
"delBio" => [
|
"delBio" => [
|
||||||
],
|
],
|
||||||
"delStruct" => [
|
"delStruct" => [
|
||||||
|
@ -81,7 +81,7 @@ class BetterNormal extends Generator {
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
protected $waterHeight = 63;
|
protected $waterHeight = 63;
|
||||||
private $noiseBase;
|
protected $noiseBase;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Picks a biome by X and Z
|
* 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)
|
* Generates the generation kernel based on smooth size (here 2)
|
||||||
*/
|
*/
|
||||||
private static function generateKernel() {
|
protected static function generateKernel() {
|
||||||
self::$GAUSSIAN_KERNEL = [ ];
|
self::$GAUSSIAN_KERNEL = [ ];
|
||||||
|
|
||||||
$bellSize = 1 / self::$SMOOTH_SIZE;
|
$bellSize = 1 / self::$SMOOTH_SIZE;
|
||||||
|
|
|
@ -53,7 +53,7 @@ class DeadbushPopulator extends AmountPopulator {
|
||||||
* @param $z
|
* @param $z
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
private function getHighestWorkableBlock($x, $z){
|
protected function getHighestWorkableBlock($x, $z){
|
||||||
for($y = Level::Y_MAX - 1; $y > 0; --$y){
|
for($y = Level::Y_MAX - 1; $y > 0; --$y){
|
||||||
$b = $this->level->getBlockIdAt($x, $y, $z);
|
$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){
|
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
|
* @param $z
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
private function getHighestWorkableBlock($x, $z){
|
protected function getHighestWorkableBlock($x, $z){
|
||||||
for($y = Level::Y_MAX - 1; $y > 0; --$y){
|
for($y = Level::Y_MAX - 1; $y > 0; --$y){
|
||||||
$b = $this->level->getBlockIdAt($x, $y, $z);
|
$b = $this->level->getBlockIdAt($x, $y, $z);
|
||||||
if($b === Block::DIRT or $b === Block::GRASS){
|
if($b === Block::DIRT or $b === Block::GRASS){
|
||||||
|
|
|
@ -41,7 +41,7 @@ class FloatingIslandPopulator extends AmountPopulator {
|
||||||
* @param $random pocketmine\utils\Random
|
* @param $random pocketmine\utils\Random
|
||||||
*/
|
*/
|
||||||
/** @var ChunkManager */
|
/** @var ChunkManager */
|
||||||
private $level;
|
protected $level;
|
||||||
|
|
||||||
public function populate(ChunkManager $level, $chunkX, $chunkZ, Random $random) {
|
public function populate(ChunkManager $level, $chunkX, $chunkZ, Random $random) {
|
||||||
$this->level = $level;
|
$this->level = $level;
|
||||||
|
|
|
@ -29,7 +29,7 @@ class Cactus extends Object {
|
||||||
* @param $z int
|
* @param $z int
|
||||||
* @param $random pocketmine\utils\Random
|
* @param $random pocketmine\utils\Random
|
||||||
*/
|
*/
|
||||||
private $totalHeight;
|
protected $totalHeight;
|
||||||
|
|
||||||
public function canPlaceObject(ChunkManager $level, int $x, int $y, int $z, Random $random): bool {
|
public function canPlaceObject(ChunkManager $level, int $x, int $y, int $z, Random $random): bool {
|
||||||
$this->totalHeight = 1 + $random->nextBoundedInt(3);
|
$this->totalHeight = 1 + $random->nextBoundedInt(3);
|
||||||
|
|
|
@ -39,7 +39,7 @@ class FallenTree extends Object {
|
||||||
protected $tree;
|
protected $tree;
|
||||||
protected $direction;
|
protected $direction;
|
||||||
protected $random;
|
protected $random;
|
||||||
private $length = 0;
|
protected $length = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Constructs the class
|
* Constructs the class
|
||||||
|
|
|
@ -30,7 +30,7 @@ class SugarCane extends Object {
|
||||||
* @param $z int
|
* @param $z int
|
||||||
* @param $random pocketmine\utils\Random
|
* @param $random pocketmine\utils\Random
|
||||||
*/
|
*/
|
||||||
private $totalHeight;
|
protected $totalHeight;
|
||||||
|
|
||||||
public function canPlaceObject(ChunkManager $level, int $x, int $y, int $z, Random $random): bool {
|
public function canPlaceObject(ChunkManager $level, int $x, int $y, int $z, Random $random): bool {
|
||||||
$this->totalHeight = 1 + $random->nextBoundedInt(3);
|
$this->totalHeight = 1 + $random->nextBoundedInt(3);
|
||||||
|
|
|
@ -108,8 +108,8 @@ class Temple extends Object {
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
/** @var ChunkManager */
|
/** @var ChunkManager */
|
||||||
private $level;
|
protected $level;
|
||||||
private $direction = 0;
|
protected $direction = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Checks if a temple is placeable
|
* Checks if a temple is placeable
|
||||||
|
|
Loading…
Reference in a new issue