From ed8c2eeccd025e2a3df5e741dcc940c9e68caef0 Mon Sep 17 00:00:00 2001 From: kotyaralih <62548070+kotyaralih@users.noreply.github.com> Date: Tue, 28 Dec 2021 10:40:44 -0800 Subject: [PATCH] k --- src/Player.php | 4 ++-- src/pmf/Level.php | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Player.php b/src/Player.php index b2ac9586..d3837495 100644 --- a/src/Player.php +++ b/src/Player.php @@ -192,8 +192,8 @@ class Player{ $c = key($this->chunksOrder); $d = @$this->chunksOrder[$c]; - if($c === null or $d > $this->server->api->getProperty("view-distance")){ - $this->server->schedule(50, array($this, "getNextChunk")); + if($c === null or $d === null){ + $this->server->schedule(40, array($this, "getNextChunk")); return false; } unset($this->chunksOrder[$c]); diff --git a/src/pmf/Level.php b/src/pmf/Level.php index 8fbd2ae2..9621b9c1 100644 --- a/src/pmf/Level.php +++ b/src/pmf/Level.php @@ -200,14 +200,16 @@ class PMFLevel extends PMF{ } public function loadChunk($X, $Z){ - $X = (int) $X; - $Z = (int) $Z; - $index = $this->getIndex($X, $Z); + + $index = self::getIndex($X, $Z); + if($this->isChunkLoaded($X, $Z)){ return true; + }elseif(!isset($this->locationTable[$index])){ return false; } + $info = $this->locationTable[$index]; $this->seek($info[0]);