Closed OgelGames closed 3 years ago
Currently the craftdb sends crafting recipes like this:
{ action = "normal", craft = { width = 3, grid = { "technic:mv_battery_box0", "technic:mv_battery_box0", "technic:mv_battery_box0", "technic:mv_battery_box0", "technic:hv_transformer", "technic:mv_battery_box0", [8] = "technic:hv_cable" } }, inputs = { ["technic:hv_cable"] = 1, ["technic:mv_battery_box0"] = 5, ["technic:hv_transformer"] = 1 }, outputs = { ["technic:hv_battery_box0"] = 1 }, time = 1 }
However, for sending the recipe to an autocrafter, the craft table needs to be reformatted like this:
craft
craft = { {"technic:mv_battery_box0", "technic:mv_battery_box0", "technic:mv_battery_box0"}, {"technic:mv_battery_box0", "technic:hv_transformer", "technic:mv_battery_box0"}, {"", "technic:hv_cable", ""} }
Though this requires very little code to do, IMO it would make more sense to send the craft table in the correct format like this:
{ action = "normal", craft = { {"technic:mv_battery_box0", "technic:mv_battery_box0", "technic:mv_battery_box0"}, {"technic:mv_battery_box0", "technic:hv_transformer", "technic:mv_battery_box0"}, {"", "technic:hv_cable", ""} }, inputs = { ["technic:hv_cable"] = 1, ["technic:mv_battery_box0"] = 5, ["technic:hv_transformer"] = 1 }, outputs = { ["technic:hv_battery_box0"] = 1 }, time = 1 }
Good point. Looks like "craft" is populated in the function CraftDB:canonicalize_regular_recipe, so the change should be made there.
CraftDB:canonicalize_regular_recipe
Currently the craftdb sends crafting recipes like this:
However, for sending the recipe to an autocrafter, the
craft
table needs to be reformatted like this:Though this requires very little code to do, IMO it would make more sense to send the
craft
table in the correct format like this: