sanity check

This commit is contained in:
Dylan K. Taylor 2021-11-02 15:26:54 +00:00
parent 65ef9f786a
commit facfd7c04a
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -2928,6 +2928,9 @@ class World implements ChunkManager{
foreach($adjacentChunks as $relativeChunkHash => $adjacentChunk){
World::getXZ($relativeChunkHash, $relativeX, $relativeZ);
if($relativeX < -1 || $relativeX > 1 || $relativeZ < -1 || $relativeZ > 1){
throw new AssumptionFailedError("Adjacent chunks should be in range -1 ... +1 coordinates");
}
$this->setChunk($x + $relativeX, $z + $relativeZ, $adjacentChunk);
}