first look at separating Entity and Location

This commit is contained in:
Dylan K. Taylor
2019-08-19 17:20:34 +01:00
parent 591d35889e
commit 2d4a32fc77
36 changed files with 302 additions and 257 deletions

View File

@ -62,7 +62,7 @@ class PrimedTNT extends Entity implements Explosive{
$this->fuse = $nbt->getShort("Fuse", 80, true);
$this->world->addSound($this, new IgniteSound());
$this->getWorld()->addSound($this->location, new IgniteSound());
}
@ -100,7 +100,7 @@ class PrimedTNT extends Entity implements Explosive{
$ev = new ExplosionPrimeEvent($this, 4);
$ev->call();
if(!$ev->isCancelled()){
$explosion = new Explosion(Position::fromObject($this->add(0, $this->height / 2, 0), $this->world), $ev->getForce(), $this);
$explosion = new Explosion(Position::fromObject($this->location->add(0, $this->height / 2, 0), $this->getWorld()), $ev->getForce(), $this);
if($ev->isBlockBreaking()){
$explosion->explodeA();
}