mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-19 04:15:04 +00:00
Added protection for fast movements
This commit is contained in:
@@ -753,8 +753,9 @@ class Player{
|
||||
break;
|
||||
}
|
||||
if(($this->entity instanceof Entity) and $data["counter"] > $this->lastMovement){
|
||||
$this->lastMovement = $data["counter"];
|
||||
if($this->server->api->handle("player.move", $this->entity) === false){
|
||||
$this->lastMovement = $data["counter"];
|
||||
$speed = $this->entity->getSpeed();
|
||||
if(($speed > 5 and $this->gamemode !== CREATIVE) or $speed > 12 or $this->server->api->handle("player.move", $this->entity) === false){
|
||||
$this->teleport(new Vector3($this->entity->x, $this->entity->y, $this->entity->z), $this->entity->yaw, $this->entity->pitch);
|
||||
}else{
|
||||
$this->entity->setPosition($data["x"], $data["y"], $data["z"], $data["yaw"], $data["pitch"]);
|
||||
|
Reference in New Issue
Block a user