mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-11 04:17:48 +00:00
McRegion: do not create a region file when trying to read a chunk that doesn't exist
fixes #3953
This commit is contained in:
parent
5f0310a8b6
commit
4d1be4d41d
@ -391,6 +391,9 @@ class McRegion extends BaseLevelProvider{
|
|||||||
self::getRegionIndex($chunkX, $chunkZ, $regionX, $regionZ);
|
self::getRegionIndex($chunkX, $chunkZ, $regionX, $regionZ);
|
||||||
assert(is_int($regionX) and is_int($regionZ));
|
assert(is_int($regionX) and is_int($regionZ));
|
||||||
|
|
||||||
|
if(!file_exists($this->pathToRegion($regionX, $regionZ))){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
$this->loadRegion($regionX, $regionZ);
|
$this->loadRegion($regionX, $regionZ);
|
||||||
|
|
||||||
$chunkData = $this->getRegion($regionX, $regionZ)->readChunk($chunkX & 0x1f, $chunkZ & 0x1f);
|
$chunkData = $this->getRegion($regionX, $regionZ)->readChunk($chunkX & 0x1f, $chunkZ & 0x1f);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user