Merge branch 'master' into 0.17-chunks

This commit is contained in:
Dylan K. Taylor
2016-12-01 17:50:12 +00:00
13 changed files with 29 additions and 30 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;
}
}