mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-05 17:41:46 +00:00
Implement 1.20.10 short sneaking (#5892)
This commit is contained in:
parent
7132ac0ad3
commit
259cc305df
@ -217,6 +217,7 @@ abstract class Living extends Entity{
|
|||||||
public function setSneaking(bool $value = true) : void{
|
public function setSneaking(bool $value = true) : void{
|
||||||
$this->sneaking = $value;
|
$this->sneaking = $value;
|
||||||
$this->networkPropertiesDirty = true;
|
$this->networkPropertiesDirty = true;
|
||||||
|
$this->recalculateSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isSprinting() : bool{
|
public function isSprinting() : bool{
|
||||||
@ -258,6 +259,8 @@ abstract class Living extends Entity{
|
|||||||
if($this->isSwimming() || $this->isGliding()){
|
if($this->isSwimming() || $this->isGliding()){
|
||||||
$width = $size->getWidth();
|
$width = $size->getWidth();
|
||||||
$this->setSize((new EntitySizeInfo($width, $width, $width * 0.9))->scale($this->getScale()));
|
$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{
|
}else{
|
||||||
$this->setSize($size->scale($this->getScale()));
|
$this->setSize($size->scale($this->getScale()));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user