mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-17 19:50:18 +00:00
@@ -532,7 +532,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
* @return Player[]
|
||||
*/
|
||||
public function getChunkPlayers(int $chunkX, int $chunkZ) : array{
|
||||
return isset($this->playerLoaders[$index = Level::chunkHash($chunkX, $chunkZ)]) ? $this->playerLoaders[$index] : [];
|
||||
return $this->playerLoaders[Level::chunkHash($chunkX, $chunkZ)] ?? [];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -544,7 +544,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
* @return ChunkLoader[]
|
||||
*/
|
||||
public function getChunkLoaders(int $chunkX, int $chunkZ) : array{
|
||||
return isset($this->chunkLoaders[$index = Level::chunkHash($chunkX, $chunkZ)]) ? $this->chunkLoaders[$index] : [];
|
||||
return $this->chunkLoaders[Level::chunkHash($chunkX, $chunkZ)] ?? [];
|
||||
}
|
||||
|
||||
public function addChunkPacket(int $chunkX, int $chunkZ, DataPacket $packet){
|
||||
@@ -888,7 +888,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
$chunkZ = $loader->getZ() >> 4;
|
||||
|
||||
$index = Level::chunkHash($chunkX, $chunkZ);
|
||||
$existingLoaders = max(0, isset($this->chunkTickList[$index]) ? $this->chunkTickList[$index] : 0);
|
||||
$existingLoaders = max(0, $this->chunkTickList[$index] ?? 0);
|
||||
$this->chunkTickList[$index] = $existingLoaders + 1;
|
||||
for($chunk = 0; $chunk < $chunksPerLoader; ++$chunk){
|
||||
$dx = mt_rand(-$randRange, $randRange);
|
||||
@@ -1769,7 +1769,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
* @return Entity
|
||||
*/
|
||||
public function getEntity(int $entityId){
|
||||
return isset($this->entities[$entityId]) ? $this->entities[$entityId] : null;
|
||||
return $this->entities[$entityId] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1856,7 +1856,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
* @return Tile
|
||||
*/
|
||||
public function getTileById(int $tileId){
|
||||
return isset($this->tiles[$tileId]) ? $this->tiles[$tileId] : null;
|
||||
return $this->tiles[$tileId] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user