mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 20:19:44 +00:00
Added protection for fast movements
This commit is contained in:
parent
14ab386b0f
commit
88a1f83545
2 changed files with 20 additions and 8 deletions
|
|
@ -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"]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue