diff --git a/src/world/format/io/leveldb/LevelDB.php b/src/world/format/io/leveldb/LevelDB.php index f6aeafba3..6713818ac 100644 --- a/src/world/format/io/leveldb/LevelDB.php +++ b/src/world/format/io/leveldb/LevelDB.php @@ -388,7 +388,7 @@ class LevelDB extends BaseWorldProvider implements WritableWorldProvider{ $entities = []; if(($entityData = $this->db->get($index . self::TAG_ENTITY)) !== false and $entityData !== ""){ try{ - $entities = array_map(function(TreeRoot $root) : CompoundTag{ return $root->mustGetCompoundTag(); }, $nbt->readMultiple($entityData)); + $entities = array_map(fn(TreeRoot $root) => $root->mustGetCompoundTag(), $nbt->readMultiple($entityData)); }catch(NbtDataException $e){ throw new CorruptedChunkException($e->getMessage(), 0, $e); } @@ -398,7 +398,7 @@ class LevelDB extends BaseWorldProvider implements WritableWorldProvider{ $tiles = []; if(($tileData = $this->db->get($index . self::TAG_BLOCK_ENTITY)) !== false and $tileData !== ""){ try{ - $tiles = array_map(function(TreeRoot $root) : CompoundTag{ return $root->mustGetCompoundTag(); }, $nbt->readMultiple($tileData)); + $tiles = array_map(fn(TreeRoot $root) => $root->mustGetCompoundTag(), $nbt->readMultiple($tileData)); }catch(NbtDataException $e){ throw new CorruptedChunkException($e->getMessage(), 0, $e); } @@ -496,7 +496,7 @@ class LevelDB extends BaseWorldProvider implements WritableWorldProvider{ private function writeTags(array $targets, string $index, \LevelDBWriteBatch $write) : void{ if(count($targets) > 0){ $nbt = new LittleEndianNbtSerializer(); - $write->put($index, $nbt->writeMultiple(array_map(function(CompoundTag $tag) : TreeRoot{ return new TreeRoot($tag); }, $targets))); + $write->put($index, $nbt->writeMultiple(array_map(fn(CompoundTag $tag) => new TreeRoot($tag), $targets))); }else{ $write->delete($index); }