Browse Source

Changing private properties to protected

This is made to allow people to extend and use these properties.
pull/34/head
Ad5001 3 years ago
parent
commit
015967050d
9 changed files with 16 additions and 16 deletions
  1. +5
    -5
      src/Ad5001/BetterGen/generator/BetterBiomeSelector.php
  2. +3
    -3
      src/Ad5001/BetterGen/generator/BetterNormal.php
  3. +1
    -1
      src/Ad5001/BetterGen/populator/DeadbushPopulator.php
  4. +1
    -1
      src/Ad5001/BetterGen/populator/FallenTreePopulator.php
  5. +1
    -1
      src/Ad5001/BetterGen/populator/FloatingIslandPopulator.php
  6. +1
    -1
      src/Ad5001/BetterGen/structure/Cactus.php
  7. +1
    -1
      src/Ad5001/BetterGen/structure/FallenTree.php
  8. +1
    -1
      src/Ad5001/BetterGen/structure/SugarCane.php
  9. +2
    -2
      src/Ad5001/BetterGen/structure/Temple.php

+ 5
- 5
src/Ad5001/BetterGen/generator/BetterBiomeSelector.php 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;


+ 3
- 3
src/Ad5001/BetterGen/generator/BetterNormal.php 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;


+ 1
- 1
src/Ad5001/BetterGen/populator/DeadbushPopulator.php 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){


+ 1
- 1
src/Ad5001/BetterGen/populator/FallenTreePopulator.php 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){


+ 1
- 1
src/Ad5001/BetterGen/populator/FloatingIslandPopulator.php 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;


+ 1
- 1
src/Ad5001/BetterGen/structure/Cactus.php 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);


+ 1
- 1
src/Ad5001/BetterGen/structure/FallenTree.php 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


+ 1
- 1
src/Ad5001/BetterGen/structure/SugarCane.php 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);


+ 2
- 2
src/Ad5001/BetterGen/structure/Temple.php 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


Loading…
Cancel
Save