mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-10 05:34:54 +00:00
Removed incorrect unloaded chunk detection
This commit is contained in:
parent
0522052c75
commit
d7f74a6725
@ -62,7 +62,6 @@ class Player{
|
|||||||
private $chunksOrder = array();
|
private $chunksOrder = array();
|
||||||
private $lag = array(0, 0);
|
private $lag = array(0, 0);
|
||||||
private $spawnPosition;
|
private $spawnPosition;
|
||||||
private $freedChunks = true;
|
|
||||||
public $itemEnforcement;
|
public $itemEnforcement;
|
||||||
public $lastCorrect;
|
public $lastCorrect;
|
||||||
private $bigCnt;
|
private $bigCnt;
|
||||||
@ -149,19 +148,9 @@ class Player{
|
|||||||
$c = key($this->chunksOrder);
|
$c = key($this->chunksOrder);
|
||||||
$d = @$this->chunksOrder[$c];
|
$d = @$this->chunksOrder[$c];
|
||||||
if($c === null or $d > $this->server->api->getProperty("view-distance")){
|
if($c === null or $d > $this->server->api->getProperty("view-distance")){
|
||||||
if($this->freedChunks === false){
|
|
||||||
foreach($this->chunksOrder as $c => $d){
|
|
||||||
$id = explode(":", $c);
|
|
||||||
$X = $id[0];
|
|
||||||
$Z = $id[2];
|
|
||||||
$this->level->freeChunk($X, $Z, $this);
|
|
||||||
}
|
|
||||||
$this->freedChunks = true;
|
|
||||||
}
|
|
||||||
$this->server->schedule(50, array($this, "getNextChunk"));
|
$this->server->schedule(50, array($this, "getNextChunk"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$this->freedChunks = false;
|
|
||||||
unset($this->chunksOrder[$c]);
|
unset($this->chunksOrder[$c]);
|
||||||
$this->chunksLoaded[$c] = true;
|
$this->chunksLoaded[$c] = true;
|
||||||
$id = explode(":", $c);
|
$id = explode(":", $c);
|
||||||
|
@ -108,18 +108,18 @@ class Entity extends Position{
|
|||||||
$this->stack = (int) $this->data["stack"];
|
$this->stack = (int) $this->data["stack"];
|
||||||
}
|
}
|
||||||
$this->setHealth(5, "generic");
|
$this->setHealth(5, "generic");
|
||||||
$this->server->schedule(5, array($this, "update"), array(), true);
|
$this->server->schedule(10, array($this, "update"), array(), true);
|
||||||
$this->size = 0.5;
|
$this->size = 0.5;
|
||||||
break;
|
break;
|
||||||
case ENTITY_MOB:
|
case ENTITY_MOB:
|
||||||
$this->setHealth($this->data["Health"], "generic");
|
$this->setHealth($this->data["Health"], "generic");
|
||||||
$this->server->schedule(5, array($this, "update"), array(), true);
|
$this->server->schedule(10, array($this, "update"), array(), true);
|
||||||
//$this->setName((isset($mobs[$this->type]) ? $mobs[$this->type]:$this->type));
|
//$this->setName((isset($mobs[$this->type]) ? $mobs[$this->type]:$this->type));
|
||||||
$this->size = 1;
|
$this->size = 1;
|
||||||
break;
|
break;
|
||||||
case ENTITY_FALLING:
|
case ENTITY_FALLING:
|
||||||
$this->setHealth(PHP_INT_MAX, "generic");
|
$this->setHealth(PHP_INT_MAX, "generic");
|
||||||
$this->server->schedule(5, array($this, "update"), array(), true);
|
$this->server->schedule(10, array($this, "update"), array(), true);
|
||||||
$this->size = 0.98;
|
$this->size = 0.98;
|
||||||
break;
|
break;
|
||||||
case ENTITY_OBJECT:
|
case ENTITY_OBJECT:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user