mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-12 12:55:21 +00:00
Sweet Berry Bush now absorbs fall damage (#4876)
This commit is contained in:
parent
dfd8c4e4b8
commit
91f81d4c8e
@ -151,9 +151,11 @@ class SweetBerryBush extends Flowable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function onEntityInside(Entity $entity) : bool{
|
public function onEntityInside(Entity $entity) : bool{
|
||||||
|
if($this->age >= self::STAGE_BUSH_NO_BERRIES && $entity instanceof Living){
|
||||||
|
$entity->resetFallDistance();
|
||||||
|
|
||||||
//TODO: in MCPE, this only triggers if moving while inside the bush block - we don't have the system to deal
|
//TODO: in MCPE, this only triggers if moving while inside the bush block - we don't have the system to deal
|
||||||
//with that reliably right now
|
//with that reliably right now
|
||||||
if($this->age >= self::STAGE_BUSH_NO_BERRIES && $entity instanceof Living){
|
|
||||||
$entity->attack(new EntityDamageByBlockEvent($this, $entity, EntityDamageByBlockEvent::CAUSE_CONTACT, 1));
|
$entity->attack(new EntityDamageByBlockEvent($this, $entity, EntityDamageByBlockEvent::CAUSE_CONTACT, 1));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user