From 675583293f9f1949d4022dd2d9b759393278c93f Mon Sep 17 00:00:00 2001 From: redcrab2016 Date: Thu, 18 Feb 2016 10:54:54 +0100 Subject: [PATCH] Crash if player spawn back to Y coord. >0 & <1 The issue come from line 2664 : $v = $spawn->floor() If $spawn->y is in ]0..1[ then $v->y == 0 Then getBlockId : line 2670 use 'y' as -1 => Crash boom --- src/pocketmine/level/Level.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocketmine/level/Level.php b/src/pocketmine/level/Level.php index 282cdafc7..a071e204e 100644 --- a/src/pocketmine/level/Level.php +++ b/src/pocketmine/level/Level.php @@ -2657,7 +2657,7 @@ class Level implements ChunkManager, Metadatable{ * @return bool|Position */ public function getSafeSpawn($spawn = null){ - if(!($spawn instanceof Vector3) or $spawn->y <= 0){ + if(!($spawn instanceof Vector3) or $spawn->y < 1){ $spawn = $this->getSpawnLocation(); } if($spawn instanceof Vector3){