Player: increase max distance between movements to allow high levels of speed to work correctly

speed 255 may allow the player to move as much as 14.8 blocks per tick when sprinting.
This commit is contained in:
Dylan K. Taylor 2023-04-07 21:35:58 +01:00
parent 14c1a9550d
commit f5b4d64668
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -1231,7 +1231,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
$revert = false;
if($distanceSquared > 100){
if($distanceSquared > 225){ //15 blocks
//TODO: this is probably too big if we process every movement
/* !!! BEWARE YE WHO ENTER HERE !!!
*
@ -1243,7 +1243,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
* If you must tamper with this code, be aware that this can cause very nasty results. Do not waste our time
* asking for help if you suffer the consequences of messing with this.
*/
$this->logger->debug("Moved too fast, reverting movement");
$this->logger->debug("Moved too fast (" . sqrt($distanceSquared) . " blocks in 1 movement), reverting movement");
$this->logger->debug("Old position: " . $oldPos->asVector3() . ", new position: " . $newPos);
$revert = true;
}elseif(!$this->getWorld()->isInLoadedTerrain($newPos)){