From 259cc305df109c134fa36dde44655599e238d804 Mon Sep 17 00:00:00 2001 From: jasonw_4331 Date: Thu, 13 Jul 2023 08:36:53 -0400 Subject: [PATCH] Implement 1.20.10 short sneaking (#5892) --- src/entity/Living.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/entity/Living.php b/src/entity/Living.php index 29a8ceae8..2cf5d4053 100644 --- a/src/entity/Living.php +++ b/src/entity/Living.php @@ -217,6 +217,7 @@ abstract class Living extends Entity{ public function setSneaking(bool $value = true) : void{ $this->sneaking = $value; $this->networkPropertiesDirty = true; + $this->recalculateSize(); } public function isSprinting() : bool{ @@ -258,6 +259,8 @@ abstract class Living extends Entity{ if($this->isSwimming() || $this->isGliding()){ $width = $size->getWidth(); $this->setSize((new EntitySizeInfo($width, $width, $width * 0.9))->scale($this->getScale())); + }elseif($this->isSneaking()){ + $this->setSize((new EntitySizeInfo(3 / 4 * $size->getHeight(), $size->getWidth(), 3 / 4 * $size->getEyeHeight()))->scale($this->getScale())); }else{ $this->setSize($size->scale($this->getScale())); }