mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
goodbye php5, u wont be missed
This commit is contained in:
parent
2858b43748
commit
d7d346a237
16 changed files with 26 additions and 33 deletions
|
|
@ -395,7 +395,7 @@ class Level{
|
|||
foreach($this->usedChunks as $c => $eids){
|
||||
$xz = explode(".", $c); //bad idea, TODO use better indexes
|
||||
foreach($eids as $cid => $_){
|
||||
$p = nullsafe($this->server->clients[$cid], false);
|
||||
$p = $this->server->clients[$cid] ?? false;
|
||||
if($p instanceof Player){
|
||||
$dist = abs($xz[0] - ($p->entity->x >> 4)) + abs($xz[1] - ($p->entity->z >> 4));
|
||||
if($dist > 8){
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class BiomeSelector
|
|||
* @return Biome | false
|
||||
*/
|
||||
public static function get($id){
|
||||
return nullsafe(self::$biomes[$id], false);
|
||||
return self::$biomes[$id] ?? false;
|
||||
}
|
||||
|
||||
public function generateBiomeLookup(){
|
||||
|
|
@ -92,8 +92,8 @@ class BiomeSelector
|
|||
$temperature = (int) ($this->getTemperature($x, $z) * 63);
|
||||
$rainfall = (int) ($this->getRainfall($x, $z) * 63);
|
||||
|
||||
$biomeId = nullsafe($this->map[$temperature + ($rainfall << 6)], -1);
|
||||
return nullsafe(self::$biomes[$biomeId], $this->fallback);
|
||||
$biomeId = $this->map[$temperature + ($rainfall << 6)] ?? -1;
|
||||
return self::$biomes[$biomeId] ?? $this->fallback;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue