Convert EntityFactory to singleton

This commit is contained in:
Dylan K. Taylor
2020-04-24 22:43:02 +01:00
parent a75241ef03
commit 7d9df6af6f
12 changed files with 54 additions and 59 deletions

View File

@@ -257,7 +257,7 @@ class ItemFactory{
$this->register(new SplashPotion(ItemIds::SPLASH_POTION, $type, "Splash Potion"));
}
foreach(EntityFactory::getKnownTypes() as $className){
foreach(EntityFactory::getInstance()->getKnownTypes() as $className){
/** @var Living|string $className */
if(is_a($className, Living::class, true) and $className::NETWORK_ID !== -1){
$this->register(new SpawnEgg(ItemIds::SPAWN_EGG, $className::NETWORK_ID, "Spawn Egg", $className));