Convert ItemFactory to singleton

This commit is contained in:
Dylan K. Taylor
2020-04-24 00:18:31 +01:00
parent 13d784cd0c
commit 5a94af40e2
19 changed files with 546 additions and 546 deletions

View File

@ -70,7 +70,7 @@ class TypeConverter{
public function recipeIngredientToCoreItemStack(RecipeIngredient $ingredient) : Item{
$meta = $ingredient->getMeta();
return ItemFactory::get($ingredient->getId(), $meta === 0x7fff ? -1 : $meta, $ingredient->getCount());
return ItemFactory::getInstance()->get($ingredient->getId(), $meta === 0x7fff ? -1 : $meta, $ingredient->getCount());
}
public function coreItemStackToNet(Item $itemStack) : ItemStack{
@ -124,7 +124,7 @@ class TypeConverter{
}
end:
return ItemFactory::get(
return ItemFactory::getInstance()->get(
$itemStack->getId(),
$meta !== 0x7fff ? $meta : -1,
$itemStack->getCount(),