mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 16:24:05 +00:00
Living: Trigger fall sounds on the nearest collidable block below
we can't have landed on it unless it actually has a collision box - otherwise, we only landed _in_ it. This assumes, of course, that no blocks have bounding boxes >= 2 blocks tall, which currently none do.
This commit is contained in:
parent
d329bfb25d
commit
17dfd2cc52
@ -318,7 +318,7 @@ abstract class Living extends Entity{
|
||||
}else{
|
||||
$fallBlockPos = $this->location->floor();
|
||||
$fallBlock = $this->getWorld()->getBlock($fallBlockPos);
|
||||
if($fallBlock->getId() === BlockLegacyIds::AIR){
|
||||
if(count($fallBlock->getCollisionBoxes()) === 0){
|
||||
$fallBlockPos = $fallBlockPos->subtract(0, 1, 0);
|
||||
$fallBlock = $this->getWorld()->getBlock($fallBlockPos);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user