minetest-mods / technic

Technic mod for Minetest
Other
145 stars 155 forks source link

Some recipes do not appear in built-in v5.4.0 crafting guide #585

Closed jonathancutting closed 1 year ago

jonathancutting commented 3 years ago

Some items in Technic either show no recipes, circular recipes, or uncraftable recipes in the new, built-in craft guide in Minetest 5.4.0. For example, the following items are uncraftable due to either circular recipes, recipes containing items that cannot be mined, crafted, or harvested, or no recipes...

Technic and all required dependencies are up-to-date as of 10 Apr 2021. To reproduce issue, go to the default crafting guide (not the Crafting Guide mod) in the inventory in Minetest client v5.4.0, and view the crafting recipes for any of the items listed above.

jonathancutting commented 3 years ago

I've not spent much time learning Lua, but it looks similar to other object-oriented languages, so I've been looking through the code to see if I can diagnose the problem here. I found this in /technic/crafts.lua.

 4 -- Remove some recipes
 5 -- Bronze
 6 minetest.clear_craft({
 7     type = "shapeless",
 8     output = "default:bronze_ingot"
 9 })
10 -- Restore recipe for bronze block to ingots
11 minetest.register_craft({
12     output = "default:bronze_ingot 9",
13     recipe = {
14         {"default:bronzeblock"}
15     }
16 })

If I understand this correctly, it removes any existing recipes for the bronze ingot, and replaces it with a recipe that just has a bronze block. I don't want to edit the code myself and do a git push, since I'm not well-versed in the language (and I don't want to break anything). However, would this restore the original recipe for a bronze ingot, if I rewrote lines 13 through 15 like this?

recipe = {
    {"default:bronzeblock"}
},
{
    {'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'},
    {'default:copper_ingot', 'default:tin_ingot', 'default:copper_ingot'},
    {'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'}
}

Also, I notice some of the recipes in craft.lua use double quotes and some use single quotes. Which is the correct syntax, and could this be breaking things?

auouymous commented 3 years ago

The missing recipes are created with machines, perhaps the default craft guide can't display them, or maybe technic must support every craft guide.

The bronze recipe removes any existing simpler recipes and later adds a more complex recipe. Put 7 copper ingots and 1 tin ingot in an alloy furnace to get 8 bronze ingots. Or you can comment out lines 6 to 16 to restore any existing recipes.

The quotes don't break anything, they can both be used.

jonathancutting commented 3 years ago

Aha! I did not know this. I thought it was a bug, but it's by design. Good to know. Do you have any suggestions for a better craft guide that might show these Technic recipes? I'll close this bug report once I have an alternative one working.

auouymous commented 3 years ago

The machine recipes work fine in the unified inventory mod. There is another issue to support i3 and a PR for the craftguide mod. So it might be better to leave this issue open and rename to "Add compatibility with built-in v5.4.0 crafting guide".

S-S-X commented 3 years ago

Some recipes do not work well with any of supported crafting guides and this is because recipes cannot display multiple outputs, these recipes are actively skipped when registering recipes for crafting guides.

edit. Basically this would need ability to display multiple outputs for recipe and current crafting guides afaik do not support this. Lately I did try displaying recipes with unified inventory showing only first output stack, it kind of does work but can be confusing as only one output stack can be displayed.

Here's link to simple experiment: https://github.com/mt-mods/technic/compare/centrifuge-recipes-to-guide

jonathancutting commented 3 years ago

I installed Unified Inventory, and that seems to display the missing recipes I was looking for. As for @S-S-X's issue, I'm not sure I follow... In any case, should I close this issue or rename it as suggested by @auouymous?

S-S-X commented 3 years ago

I installed Unified Inventory, and that seems to display the missing recipes I was looking for. As for @S-S-X's issue, I'm not sure I follow... In any case, should I close this issue or rename it as suggested by @auouymous?

That was just note about additional actively skipped recipes, I mean there's multiple issues with many different recipe types not showing up and multiple causes for those. Not just some single specific problem with some specific recipes.

Yes it could maybe be better to have multiple bit more specific missing recipe issues for all these.

Sharpik commented 2 years ago

Hi, this mod should support even I3 recipes guide as do this commit: https://git.minetest.org/RealBadAngel/technic/commit/1c219487d3f4dd03c01ff9aa1f298c7c18c7e189?style=split&whitespace=ignore-change

SmallJoker commented 1 year ago

Technic uses custom crafting recipes which cannot be represented with minetest.register_craft. If a craft guide does not show Technic recipes but has an API to register them for display, please open an issue or (preferably) a PR to add support for that guide to technic.