{"id":18522062,"url":"https://github.com/minetest-mods/simplecrafting_lib","last_synced_at":"2025-06-15T00:05:58.844Z","repository":{"id":143485054,"uuid":"90873882","full_name":"minetest-mods/simplecrafting_lib","owner":"minetest-mods","description":"A library adding a simplified, extensible, gridless crafting system for Minetest mods to use","archived":false,"fork":false,"pushed_at":"2020-01-20T17:58:53.000Z","size":654,"stargazers_count":4,"open_issues_count":1,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-10T03:39:55.766Z","etag":null,"topics":["crafting","library","minetest","minetest-mod","mod"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/minetest-mods.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-10T14:31:18.000Z","updated_at":"2024-05-28T16:20:52.000Z","dependencies_parsed_at":"2023-07-09T08:01:16.851Z","dependency_job_id":null,"html_url":"https://github.com/minetest-mods/simplecrafting_lib","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/minetest-mods/simplecrafting_lib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minetest-mods%2Fsimplecrafting_lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minetest-mods%2Fsimplecrafting_lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minetest-mods%2Fsimplecrafting_lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minetest-mods%2Fsimplecrafting_lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/minetest-mods","download_url":"https://codeload.github.com/minetest-mods/simplecrafting_lib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minetest-mods%2Fsimplecrafting_lib/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259901381,"owners_count":22929224,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crafting","library","minetest","minetest-mod","mod"],"created_at":"2024-11-06T17:28:54.129Z","updated_at":"2025-06-15T00:05:58.820Z","avatar_url":"https://github.com/minetest-mods.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"This mod adds a new crafting system, either in parallel to the default grid-based crafting system or as complete replacement to it. The new crafting system doesn't care about the arrangement of raw materials, only the relative proportions of them. Effectively, every recipe is now \"shapeless\".\n\nBy default, this mod has no effect on its own - it's intended as an API that allows it to be used by other mods, for example creating specialized crafting tables with particular lists of recipes available. However, if you set the \"simplecrafting_lib_override_default_player_crafting\" configuration variable to \"true\" it will replace the player's inventory crafting interface with one derived from this system.\n\nYou can continue to use minetest.register_craft to register crafts as normal, this mod hooks into it and can reinterpret recipes registered via it to use with the new crafting system as well.\n\nAlternately, use the \"simplecrafting_lib.register\" method to register recipes for the new\nsystem exclusively. Examples are given below:\n\n\tsimplecrafting_lib.register(\"table\", {\n\t\tinput = {\n\t\t\t[\"group:stone\"] = 1,\n\t\t\t[\"bucket:lava_bucket\"] = 1,\n\t\t},\n\t\toutput = \"default:obsidian 2\",\n\t\n\t\t-- Items which the crafting recipe produces, but is not\n\t\t-- formally used to make.\n\t\treturns = {\n\t\t\t[\"bucket:bucket\"] = 1,\n\t\t},\n\t})\n\t\n\tsimplecrafting_lib.register(\"furnace\", {\n\t\tinput = {\n\t\t\t[\"farming:flour\"] = 1,\n\t\t\t[\"simplecrafting_lib:heat\"] = 5,\n\t\t},\n\t\toutput = \"farming:bread\",\n\t})\n\t\n\tsimplecrafting_lib.register(\"fuel\", {\n\t\t-- Group names are allowed when defining fuel inputs.\n\t\t-- If there is not an item specific recipe then it will take the\n\t\t-- definition of its longest burning group\n\t\tinput = {\n\t\t\t[\"group:tree\"] = 1,\n\t\t},\n\t\toutput = \"simplecrafting_lib:heat 40\",\n\t})\n\nAs a simple example, the following code will register a filter that imports all \"normal\" crafting recipes into a craft_type called \"table\", and removes them from the legacy crafting system in the process, but leaves \"cooking\" and \"fuel\" recipes alone:\n\n\tsimplecrafting_lib.register_recipe_import_filter(function(legacy_recipe)\n\t\tif legacy_recipe.input[\"simplecrafting_lib:heat\"] then\n\t\t\treturn nil, false\n\t\telseif legacy_recipe.output and legacy_recipe.output:get_name() == \"simplecrafting_lib:heat\" then\n\t\t\treturn nil, false\n\t\telse\n\t\t\treturn \"table\", true\n\t\tend\n\tend)\n\nNote that clearing large numbers of recipes from the native crafting system can take a long time on startup, see [issue #5790 on Minetest](https://github.com/minetest/minetest/issues/5790).\n\nTo create a standard crafting table that would be able to make use of the \"table\" craft_type populated by the above recipe import filter, there's a convenience function that provides pre-generated functions for use with a crafting table node definition. The following code shows an example:\n\n\tlocal table_functions = simplecrafting_lib.generate_table_functions(\"table\", show_guides, alphabetize_items)\n\n\tlocal table_def = {\n\t\tdescription = S(\"Crafting Table\"),\n\t\tdrawtype = \"normal\",\n\t\ttiles = {\"crafting.table_top.png\", \"default_chest_top.png\",\n\t\t\t\"crafting.table_front.png\", \"crafting.table_front.png\",\n\t\t\t\"crafting.table_side.png\", \"crafting.table_side.png\"},\n\t\tsounds = default.node_sound_wood_defaults(),\n\t\tparamtype2 = \"facedir\",\n\t\tis_ground_content = false,\n\t\tgroups = {oddly_breakable_by_hand = 1, choppy=3},\n\t}\n\tfor k, v in pairs(table_functions) do\n\t\ttable_def[k] = v\n\tend\n\n\tminetest.register_node(\"crafting:table\", table_def)\n\t\nThis produces a crafting table with a formspec similar to the following:\n\n![Crafting table formspec](screenshot.png)\n\n[See api.md for more information about how to use this mod's API.](api.md)\n\nThis library is released under the MIT license.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminetest-mods%2Fsimplecrafting_lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminetest-mods%2Fsimplecrafting_lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminetest-mods%2Fsimplecrafting_lib/lists"}