extract FurnaceRecipeManager unit from CraftingManager

I'd like to have this directly provided to Furnace, but I don't know how to short of making into a singleton. Since I want to have per-furnace recipe managers (e.g. for stuff like blast furnace vs regular furnace etc), a singleton isn't really an option.
This commit is contained in:
Dylan K. Taylor
2020-06-03 18:59:59 +01:00
parent b58c425189
commit 017afead3b
4 changed files with 83 additions and 20 deletions

View File

@@ -60,7 +60,7 @@ final class CraftingManagerFromDataHelper{
if($recipe["block"] !== "furnace"){ //TODO: filter others out for now to avoid breaking economics
break;
}
$result->registerFurnaceRecipe(new FurnaceRecipe(
$result->getFurnaceRecipeManager()->register(new FurnaceRecipe(
Item::jsonDeserialize($recipe["output"]),
Item::jsonDeserialize($recipe["input"]))
);