* More ??

* fix undefined variable
This commit is contained in:
Dylan K. Taylor
2016-11-30 10:07:37 +00:00
committed by GitHub
parent 43a36dba40
commit d6629d6843
15 changed files with 23 additions and 24 deletions

View File

@ -87,9 +87,9 @@ class Flat extends Generator{
$this->preset = $preset;
$preset = explode(";", $preset);
$version = (int) $preset[0];
$blocks = isset($preset[1]) ? $preset[1] : "";
$biome = isset($preset[2]) ? $preset[2] : 1;
$options = isset($preset[3]) ? $preset[3] : "";
$blocks = $preset[1] ?? "";
$biome = $preset[2] ?? 1;
$options = $preset[3] ?? "";
preg_match_all('#^(([0-9]*x|)([0-9]{1,3})(|:[0-9]{0,2}))$#m', str_replace(",", "\n", $blocks), $matches);
$y = 0;
$this->structure = [];

View File

@ -107,7 +107,7 @@ abstract class Biome{
* @return Biome
*/
public static function getBiome($id){
return isset(self::$biomes[$id]) ? self::$biomes[$id] : self::$biomes[self::OCEAN];
return self::$biomes[$id] ?? self::$biomes[self::OCEAN];
}
public function clearPopulators(){

View File

@ -81,6 +81,6 @@ class BiomeSelector{
$rainfall = (int) ($this->getRainfall($x, $z) * 63);
$biomeId = $this->map[$temperature + ($rainfall << 6)];
return isset($this->biomes[$biomeId]) ? $this->biomes[$biomeId] : $this->fallback;
return $this->biomes[$biomeId] ?? $this->fallback;
}
}