added teleporting back, but no message about quick movement

This commit is contained in:
GameHerobrine 2022-08-05 20:03:20 +03:00
parent 78da6226f0
commit 0088f2d86d

View file

@ -1466,7 +1466,13 @@ class Player{
}
}
$speed = $this->entity->getSpeedMeasure();
$this->entity->setPosition($newPos, $packet->yaw, $packet->pitch);
if($this->blocked === true or ($this->server->api->getProperty("allow-flight") !== true and (($speed > 9 and ($this->gamemode & 0x01) === 0x00) or $speed > 20 or $this->entity->distance($newPos) > 7)) or $this->server->api->handle("player.move", $this->entity) === false){
if($this->lastCorrect instanceof Vector3){
$this->teleport($this->lastCorrect, $this->entity->yaw, $this->entity->pitch, false);
}
}else{
$this->entity->setPosition($newPos, $packet->yaw, $packet->pitch);
}
}
break;
case ProtocolInfo::PLAYER_EQUIPMENT_PACKET: