Fixing formating (again)

This commit is contained in:
Adsooi 2017-05-13 23:42:44 +02:00
parent be6965b909
commit 668cc0de55
12 changed files with 142 additions and 137 deletions

View file

@ -74,7 +74,10 @@ class BetterNormal extends Generator {
protected static $GAUSSIAN_KERNEL = null; // From main class
protected static $SMOOTH_SIZE = 2;
protected static $options = [
"deleteBiomes" => [
"delBio" => [
],
"delStruct" => [
"Lakes"
]
];
protected $waterHeight = 63;
@ -160,11 +163,11 @@ class BetterNormal extends Generator {
$cover = Main::isOtherNS() ? new \pocketmine\level\generator\normal\populator\GroundCover() : new \pocketmine\level\generator\populator\GroundCover();
$this->generationPopulators[] = $cover;
// https://twitter.com/Ad5001P4F/status/859430935468670976
// $lake = new LakePopulator ();
// $lake->setBaseAmount(0);
// $lake->setRandomAmount(1);
// $this->generationPopulators [] = $lake;
if() {
$lake = new LakePopulator();
$lake->setBaseAmount(0);
$lake->setRandomAmount(1);
$this->generationPopulators[] = $lake;
$cave = new CavePopulator ();
$cave->setBaseAmount(0);
@ -217,7 +220,7 @@ class BetterNormal extends Generator {
* @return bool
*/
public static function registerBiome(Biome $biome): bool {
if(\Ad5001\BetterGen\utils\CommonUtils::in_arrayi($biome->getName(), self::$options["deleteBiomes"])) {
if(\Ad5001\BetterGen\utils\CommonUtils::in_arrayi($biome->getName(), self::$options["delBio"])) {
return false;
}
foreach(self::$levels as $lvl) if(isset($lvl->selector)) $lvl->selector->addBiome($biome); // If no selector created, it would cause errors. These will be added when selectoes
@ -374,15 +377,17 @@ class BetterNormal extends Generator {
public function __construct(array $options = []) {
self::$options["preset"] = $options["preset"];
$options = (array) json_decode($options["preset"]);
if(isset($options["deleteBiomes"]) && is_string($options["deleteBiomes"])) {
$options["deleteBiomes"] = explode(",", $options["deleteBiomes"]);
if(count($options["deleteBiomes"]) !== 0) {
self::$options["deleteBiomes"] = $options["deleteBiomes"];
if(isset($options["delBio"])) {
if(is_string($options["de"])) $options["delBio"] = explode(",", $options["delBio"]);
if(count($options["delBio"]) !== 0) {
self::$options["delBio"] = $options["delBio"];
}
}
if(isset($options["deleteBiomes"]) && count($options["deleteBiomes"]) !== 0) {
self::$options["deleteBiomes"] = $options["deleteBiomes"];
if(isset($options["delStruct"])) {
if(is_string($options["delStruct"])) $options["delStruct"] = explode(",", $options["delStruct"]);
if(count($options["delStruct"]) !== 0) {
self::$options["delStruct"] = $options["delStruct"];
}
}
if (self::$GAUSSIAN_KERNEL === null) {
self::generateKernel ();