mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-23 04:59:46 +00:00
added teleporting back, but no message about quick movement
This commit is contained in:
parent
78da6226f0
commit
0088f2d86d
1 changed files with 7 additions and 1 deletions
|
|
@ -1466,7 +1466,13 @@ class Player{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$speed = $this->entity->getSpeedMeasure();
|
$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;
|
break;
|
||||||
case ProtocolInfo::PLAYER_EQUIPMENT_PACKET:
|
case ProtocolInfo::PLAYER_EQUIPMENT_PACKET:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue