From dd17adeaaf96745ff78dd39107adc9f9f9a43c6d Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 25 May 2025 11:33:47 +0100 Subject: [PATCH] Reintroduce step height additions for minor-next Revert "Revert change that can't go on stable" This reverts commit a554d2acf5db00f577493517e36bb3ad07a6bdd0. --- src/entity/Entity.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/entity/Entity.php b/src/entity/Entity.php index d73356df86..73a0b3a9c7 100644 --- a/src/entity/Entity.php +++ b/src/entity/Entity.php @@ -1191,12 +1191,14 @@ abstract class Entity{ $moveBB->offset(0, 0, $dz); - if($this->stepHeight > 0 && $fallingFlag && ($wantedX !== $dx || $wantedZ !== $dz)){ + $stepHeight = $this->getStepHeight(); + + if($stepHeight > 0 && $fallingFlag && ($wantedX !== $dx || $wantedZ !== $dz)){ $cx = $dx; $cy = $dy; $cz = $dz; $dx = $wantedX; - $dy = $this->stepHeight; + $dy = $stepHeight; $dz = $wantedZ; $stepBB = clone $this->boundingBox; @@ -1266,6 +1268,14 @@ abstract class Entity{ Timings::$entityMove->stopTiming(); } + public function setStepHeight(float $stepHeight) : void{ + $this->stepHeight = $stepHeight; + } + + public function getStepHeight() : float{ + return $this->stepHeight; + } + protected function checkGroundState(float $wantedX, float $wantedY, float $wantedZ, float $dx, float $dy, float $dz) : void{ $this->isCollidedVertically = $wantedY !== $dy; $this->isCollidedHorizontally = ($wantedX !== $dx || $wantedZ !== $dz);