mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-04 08:56:15 +00:00
Living: alter eye height so the player doesn't drown on the surface of water when swimming
fixes #4989
This commit is contained in:
@ -256,8 +256,7 @@ abstract class Living extends Entity{
|
|||||||
$size = $this->getInitialSizeInfo();
|
$size = $this->getInitialSizeInfo();
|
||||||
if($this->isSwimming() || $this->isGliding()){
|
if($this->isSwimming() || $this->isGliding()){
|
||||||
$width = $size->getWidth();
|
$width = $size->getWidth();
|
||||||
//we don't actually know an appropriate eye height for a swimming mob, but 2/3 should be good enough.
|
$this->setSize((new EntitySizeInfo($width, $width, $width * 0.9))->scale($this->getScale()));
|
||||||
$this->setSize((new EntitySizeInfo($width, $width, $width * 2 / 3))->scale($this->getScale()));
|
|
||||||
}else{
|
}else{
|
||||||
$this->setSize($size->scale($this->getScale()));
|
$this->setSize($size->scale($this->getScale()));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user