mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 19:02:59 +00:00
@ -62,6 +62,6 @@ abstract class LevelProviderManager{
|
||||
public static function getProviderByName($name){
|
||||
$name = trim(strtolower($name));
|
||||
|
||||
return isset(self::$providers[$name]) ? self::$providers[$name] : null;
|
||||
return self::$providers[$name] ?? null;
|
||||
}
|
||||
}
|
@ -117,7 +117,7 @@ class Anvil extends McRegion{
|
||||
* @return RegionLoader
|
||||
*/
|
||||
protected function getRegion($x, $z){
|
||||
return isset($this->regions[$index = Level::chunkHash($x, $z)]) ? $this->regions[$index] : null;
|
||||
return $this->regions[Level::chunkHash($x, $z)] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -355,8 +355,7 @@ abstract class BaseFullChunk implements FullChunk{
|
||||
}
|
||||
|
||||
public function getTile($x, $y, $z){
|
||||
$index = ($z << 12) | ($x << 8) | $y;
|
||||
return isset($this->tileList[$index]) ? $this->tileList[$index] : null;
|
||||
return $this->tileList[($z << 12) | ($x << 8) | $y] ?? null;
|
||||
}
|
||||
|
||||
public function isLoaded(){
|
||||
|
@ -220,7 +220,7 @@ class McRegion extends BaseLevelProvider{
|
||||
}
|
||||
|
||||
public function unloadChunk($x, $z, $safe = true){
|
||||
$chunk = isset($this->chunks[$index = Level::chunkHash($x, $z)]) ? $this->chunks[$index] : null;
|
||||
$chunk = $this->chunks[$index = Level::chunkHash($x, $z)] ?? null;
|
||||
if($chunk instanceof FullChunk and $chunk->unload(false, $safe)){
|
||||
unset($this->chunks[$index]);
|
||||
return true;
|
||||
@ -246,7 +246,7 @@ class McRegion extends BaseLevelProvider{
|
||||
* @return RegionLoader
|
||||
*/
|
||||
protected function getRegion($x, $z){
|
||||
return isset($this->regions[$index = Level::chunkHash($x, $z)]) ? $this->regions[$index] : null;
|
||||
return $this->regions[Level::chunkHash($x, $z)] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user