mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Cancel past movements
This commit is contained in:
parent
4ff9753ede
commit
9bd4b02908
@ -33,6 +33,7 @@ class Player{
|
||||
private $lastBuffer = 0;
|
||||
private $recovery = array();
|
||||
private $evid = array();
|
||||
public $lastMovement = 0;
|
||||
public $timeout;
|
||||
public $connected = true;
|
||||
public $clientID;
|
||||
@ -741,7 +742,8 @@ class Player{
|
||||
if($this->loggedIn === false){
|
||||
break;
|
||||
}
|
||||
if($this->entity instanceof Entity){
|
||||
if(($this->entity instanceof Entity) and $data["counter"] > $this->lastMovement){
|
||||
$this->lastMovement = $data["counter"];
|
||||
$this->entity->setPosition($data["x"], $data["y"], $data["z"], $data["yaw"], $data["pitch"]);
|
||||
$this->server->api->dhandle("player.move", $this->entity);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user