From 5bf440d820cd8d0de12c5bd8ddf8f4f5ae7342e9 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Sat, 1 Mar 2014 21:45:07 +0100 Subject: [PATCH] Fixed level upgrade and direct save on load --- src/pmf/PMFLevel.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pmf/PMFLevel.php b/src/pmf/PMFLevel.php index acb8776cf..540e298c5 100644 --- a/src/pmf/PMFLevel.php +++ b/src/pmf/PMFLevel.php @@ -243,9 +243,8 @@ class PMFLevel extends PMF{ ); $this->chunks[$index] = array(); $this->chunkChange[$index] = array(-1 => false); - for($Y = 0; $Y < $this->chunkInfo[$index][0]; ++$Y){ - $t = 1 << $Y; - if(($this->chunkInfo[$index][0] & $t) === $t){ + for($Y = 0; $Y < 8; ++$Y){ + if(($this->chunkInfo[$index][0] & (1 << $Y)) !== 0){ // 4096 + 2048 + 2048, Block Data, Meta, Light if(strlen($this->chunks[$index][$Y] = gzread($chunk, 8192)) < 8192){ console("[NOTICE] Empty corrupt chunk detected [$X,$Z,:$Y], recovering contents", true, true, 2);