Sweet Berry Bush now absorbs fall damage (#4876)

This commit is contained in:
ipad54 2022-03-03 22:00:44 +03:00 committed by GitHub
parent dfd8c4e4b8
commit 91f81d4c8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -151,9 +151,11 @@ class SweetBerryBush extends Flowable{
}
public function onEntityInside(Entity $entity) : bool{
//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
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
//with that reliably right now
$entity->attack(new EntityDamageByBlockEvent($this, $entity, EntityDamageByBlockEvent::CAUSE_CONTACT, 1));
}
return true;