McRegion: do not create a region file when trying to read a chunk that doesn't exist

fixes #3953
This commit is contained in:
Dylan K. Taylor 2020-12-07 18:44:49 +00:00
parent 5f0310a8b6
commit 4d1be4d41d

View File

@ -391,6 +391,9 @@ class McRegion extends BaseLevelProvider{
self::getRegionIndex($chunkX, $chunkZ, $regionX, $regionZ);
assert(is_int($regionX) and is_int($regionZ));
if(!file_exists($this->pathToRegion($regionX, $regionZ))){
return null;
}
$this->loadRegion($regionX, $regionZ);
$chunkData = $this->getRegion($regionX, $regionZ)->readChunk($chunkX & 0x1f, $chunkZ & 0x1f);