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 $GAUSSIAN_KERNEL = null; // From main class
protected static $SMOOTH_SIZE = 2; protected static $SMOOTH_SIZE = 2;
protected static $options = [ protected static $options = [
"deleteBiomes" => [ "delBio" => [
],
"delStruct" => [
"Lakes"
] ]
]; ];
protected $waterHeight = 63; 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(); $cover = Main::isOtherNS() ? new \pocketmine\level\generator\normal\populator\GroundCover() : new \pocketmine\level\generator\populator\GroundCover();
$this->generationPopulators[] = $cover; $this->generationPopulators[] = $cover;
// https://twitter.com/Ad5001P4F/status/859430935468670976 if() {
// $lake = new LakePopulator (); $lake = new LakePopulator();
// $lake->setBaseAmount(0); $lake->setBaseAmount(0);
// $lake->setRandomAmount(1); $lake->setRandomAmount(1);
// $this->generationPopulators [] = $lake; $this->generationPopulators[] = $lake;
$cave = new CavePopulator (); $cave = new CavePopulator ();
$cave->setBaseAmount(0); $cave->setBaseAmount(0);
@ -217,7 +220,7 @@ class BetterNormal extends Generator {
* @return bool * @return bool
*/ */
public static function registerBiome(Biome $biome): 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; 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 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 = []) { public function __construct(array $options = []) {
self::$options["preset"] = $options["preset"]; self::$options["preset"] = $options["preset"];
$options = (array) json_decode($options["preset"]); $options = (array) json_decode($options["preset"]);
if(isset($options["deleteBiomes"]) && is_string($options["deleteBiomes"])) { if(isset($options["delBio"])) {
$options["deleteBiomes"] = explode(",", $options["deleteBiomes"]); if(is_string($options["de"])) $options["delBio"] = explode(",", $options["delBio"]);
if(count($options["deleteBiomes"]) !== 0) { if(count($options["delBio"]) !== 0) {
self::$options["deleteBiomes"] = $options["deleteBiomes"]; self::$options["delBio"] = $options["delBio"];
} }
} }
if(isset($options["delStruct"])) {
if(isset($options["deleteBiomes"]) && count($options["deleteBiomes"]) !== 0) { if(is_string($options["delStruct"])) $options["delStruct"] = explode(",", $options["delStruct"]);
self::$options["deleteBiomes"] = $options["deleteBiomes"]; if(count($options["delStruct"]) !== 0) {
self::$options["delStruct"] = $options["delStruct"];
}
} }
if (self::$GAUSSIAN_KERNEL === null) { if (self::$GAUSSIAN_KERNEL === null) {
self::generateKernel (); self::generateKernel ();