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

@ -29,7 +29,6 @@ use pocketmine\block\BlockFactory;
class ItemFactoryTest extends TestCase{
public function setUp() : void{
BlockFactory::init();
ItemFactory::init();
}
@ -38,7 +37,7 @@ class ItemFactoryTest extends TestCase{
*/
public function testItemBlockRegistered() : void{
for($id = 0; $id < 256; ++$id){
self::assertEquals(BlockFactory::isRegistered($id), ItemFactory::isRegistered($id));
self::assertEquals(BlockFactory::getInstance()->isRegistered($id), ItemFactory::isRegistered($id));
}
}

View File

@ -24,14 +24,12 @@ declare(strict_types=1);
namespace pocketmine\item;
use PHPUnit\Framework\TestCase;
use pocketmine\block\BlockFactory;
use pocketmine\item\enchantment\Enchantment;
use pocketmine\item\enchantment\EnchantmentInstance;
class ItemTest extends TestCase{
public static function setUpBeforeClass() : void{
BlockFactory::init();
ItemFactory::init();
Enchantment::init();
}