Add a hook to enable blocks to react to projectiles colliding with them

this enables implementing blocks such as the target block.
This commit is contained in:
Dylan K. Taylor
2022-07-07 01:44:13 +01:00
parent 3e4f01d85e
commit c67e42a723
2 changed files with 9 additions and 0 deletions

View File

@ -306,5 +306,6 @@ abstract class Projectile extends Entity{
*/
protected function onHitBlock(Block $blockHit, RayTraceResult $hitResult) : void{
$this->blockHit = $blockHit->getPosition()->asVector3();
$blockHit->onProjectileHit($this, $hitResult);
}
}