From f5b4d646689948d8d3791380ac05161ef17c0730 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 7 Apr 2023 21:35:58 +0100 Subject: [PATCH] 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. --- src/player/Player.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/player/Player.php b/src/player/Player.php index 52eabac17..00f85b9ff 100644 --- a/src/player/Player.php +++ b/src/player/Player.php @@ -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)){