diff --git a/src/Player.php b/src/Player.php index 0c81c6cfe..4732d4afa 100644 --- a/src/Player.php +++ b/src/Player.php @@ -2028,6 +2028,7 @@ class Player extends PlayerEntity{ } $this->craftingItems = array(); $this->toCraft = array(); + $packet->message = TextFormat::clean($packet->message); if(trim($packet->message) != "" and strlen($packet->message) <= 255){ $message = $packet->message; if($message{0} === "/"){ //Command diff --git a/src/pmf/PMFLevel.php b/src/pmf/PMFLevel.php index 0886f60ae..e6015caab 100644 --- a/src/pmf/PMFLevel.php +++ b/src/pmf/PMFLevel.php @@ -279,9 +279,8 @@ class PMFLevel extends PMF{ $this->chunkChange[$index] = array(-1 => false); $this->chunkInfo[$index][3] = substr($chunk, $offset, 256); //Biome data $offset += 256; - 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] = substr($chunk, $offset, 8192)) < 8192){ console("[NOTICE] Empty corrupt chunk detected [$X,$Z,:$Y], recovering contents", true, true, 2);