Merge 'minor-next' into 'major-next'

Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/17449184125
This commit is contained in:
pmmp-admin-bot[bot]
2025-09-04 00:02:51 +00:00
2 changed files with 9 additions and 1 deletions

View File

@ -267,6 +267,10 @@ class Human extends Living implements ProjectileSource, InventoryHolder{
return $this->enderInventory;
}
public function getSneakOffset() : float{
return 0.31;
}
/**
* For Human entities which are not players, sets their properties such as nametag, skin and UUID from NBT.
*/

View File

@ -242,6 +242,10 @@ abstract class Living extends Entity{
$this->absorptionAttr->setValue($absorption);
}
public function getSneakOffset() : float{
return 0.0;
}
public function isSneaking() : bool{
return $this->sneaking;
}
@ -292,7 +296,7 @@ abstract class Living extends Entity{
$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()));
$this->setSize((new EntitySizeInfo($size->getHeight() - $this->getSneakOffset(), $size->getWidth(), $size->getEyeHeight() - $this->getSneakOffset()))->scale($this->getScale()));
}else{
$this->setSize($size->scale($this->getScale()));
}