diff --git a/src/Player.php b/src/Player.php index b6f137f7..06492f09 100755 --- a/src/Player.php +++ b/src/Player.php @@ -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: