Convert BlockFactory to singleton

This commit is contained in:
Dylan K. Taylor
2020-04-23 23:45:13 +01:00
parent accc0da0cb
commit 13d784cd0c
24 changed files with 1121 additions and 1121 deletions

View File

@@ -71,7 +71,7 @@ class FallingBlock extends Entity{
$damage = $nbt->getByte("Data", 0);
$this->block = BlockFactory::get($blockId, $damage);
$this->block = BlockFactory::getInstance()->get($blockId, $damage);
}
public function canCollideWith(Entity $entity) : bool{

View File

@@ -100,7 +100,7 @@ abstract class Projectile extends Entity{
break;
}
$this->blockHit = BlockFactory::get($blockId, $blockData);
$this->blockHit = BlockFactory::getInstance()->get($blockId, $blockData);
$this->blockHit->position($this->getWorld(), $blockPos->getFloorX(), $blockPos->getFloorY(), $blockPos->getFloorZ());
}while(false);
}