mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-16 02:38:54 +00:00
Fixed possible issues with tick counters being inaccurate when the server lags
This commit is contained in:
parent
b3dada4cb9
commit
e8be8550a0
@ -1651,7 +1651,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
|||||||
$this->sendAttributes();
|
$this->sendAttributes();
|
||||||
|
|
||||||
if(!$this->isAlive() and $this->spawned){
|
if(!$this->isAlive() and $this->spawned){
|
||||||
++$this->deadTicks;
|
$this->deadTicks += $tickDiff;
|
||||||
if($this->deadTicks >= 10){
|
if($this->deadTicks >= 10){
|
||||||
$this->despawnFromAll();
|
$this->despawnFromAll();
|
||||||
}
|
}
|
||||||
@ -1689,7 +1689,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
++$this->inAirTicks;
|
$this->inAirTicks += $tickDiff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1252,7 +1252,7 @@ abstract class Entity extends Location implements Metadatable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!$this->isAlive()){
|
if(!$this->isAlive()){
|
||||||
++$this->deadTicks;
|
$this->deadTicks += $tickDiff;
|
||||||
if($this->deadTicks >= 10){
|
if($this->deadTicks >= 10){
|
||||||
$this->despawnFromAll();
|
$this->despawnFromAll();
|
||||||
if(!$this->isPlayer){
|
if(!$this->isPlayer){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user