mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 20:49:43 +00:00
Cancel past movements
This commit is contained in:
parent
4ff9753ede
commit
9bd4b02908
1 changed files with 3 additions and 1 deletions
|
|
@ -33,6 +33,7 @@ class Player{
|
||||||
private $lastBuffer = 0;
|
private $lastBuffer = 0;
|
||||||
private $recovery = array();
|
private $recovery = array();
|
||||||
private $evid = array();
|
private $evid = array();
|
||||||
|
public $lastMovement = 0;
|
||||||
public $timeout;
|
public $timeout;
|
||||||
public $connected = true;
|
public $connected = true;
|
||||||
public $clientID;
|
public $clientID;
|
||||||
|
|
@ -741,7 +742,8 @@ class Player{
|
||||||
if($this->loggedIn === false){
|
if($this->loggedIn === false){
|
||||||
break;
|
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->entity->setPosition($data["x"], $data["y"], $data["z"], $data["yaw"], $data["pitch"]);
|
||||||
$this->server->api->dhandle("player.move", $this->entity);
|
$this->server->api->dhandle("player.move", $this->entity);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue