From facfd7c04a25ef8c79bad8547e493b97cae2e7ad Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 2 Nov 2021 15:26:54 +0000 Subject: [PATCH] sanity check --- src/world/World.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/world/World.php b/src/world/World.php index 27444ad6a..a54065035 100644 --- a/src/world/World.php +++ b/src/world/World.php @@ -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); }