Fix projectiles throwing errors on launching, fix #1942 (#1943)

* Fix Projectile::setOwningEntity() on null error
This commit is contained in:
Muqsit 2018-01-20 22:07:53 +04:00 committed by Dylan K. Taylor
parent 3939e2d9dd
commit 29e06e30b2

View File

@ -43,10 +43,10 @@ abstract class Projectile extends Entity{
public $hadCollision = false;
public function __construct(Level $level, CompoundTag $nbt, Entity $shootingEntity = null){
parent::__construct($level, $nbt);
if($shootingEntity !== null){
$this->setOwningEntity($shootingEntity);
}
parent::__construct($level, $nbt);
}
public function attack(EntityDamageEvent $source){