mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-19 04:05:31 +00:00
Living: do not loop downwards searching for collision block, closes #3517
This commit is contained in:
parent
64bb126bf5
commit
7aca41a530
@ -262,16 +262,15 @@ abstract class Living extends Entity{
|
|||||||
}else{
|
}else{
|
||||||
$fallBlockPos = $this->location->floor();
|
$fallBlockPos = $this->location->floor();
|
||||||
$fallBlock = $this->getWorld()->getBlock($fallBlockPos);
|
$fallBlock = $this->getWorld()->getBlock($fallBlockPos);
|
||||||
for(
|
if($fallBlock->getId() === BlockLegacyIds::AIR){
|
||||||
;
|
$fallBlockPos = $fallBlockPos->subtract(0, 1, 0);
|
||||||
$fallBlock->getId() === BlockLegacyIds::AIR;
|
$fallBlock = $this->getWorld()->getBlock($fallBlockPos);
|
||||||
$fallBlockPos = $fallBlockPos->subtract(0, 1, 0), $fallBlock = $this->getWorld()->getBlock($fallBlockPos)
|
|
||||||
){
|
|
||||||
//this allows the correct sound to be played when landing in snow
|
|
||||||
}
|
}
|
||||||
|
if($fallBlock->getId() !== BlockLegacyIds::AIR){
|
||||||
$this->getWorld()->addSound($this->location, new EntityLandSound($this, $fallBlock));
|
$this->getWorld()->addSound($this->location, new EntityLandSound($this, $fallBlock));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns how many armour points this mob has. Armour points provide a percentage reduction to damage.
|
* Returns how many armour points this mob has. Armour points provide a percentage reduction to damage.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user