mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-05 09:26:06 +00:00
Merge 'minor-next' into 'major-next'
Automatic merge performed by: https://github.com/pmmp/RestrictedActions/actions/runs/17449184125
This commit is contained in:
@ -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.
|
||||
*/
|
||||
|
@ -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()));
|
||||
}
|
||||
|
Reference in New Issue
Block a user