Ability to register recipes in MC-like way

This commit is contained in:
Jean-Patrick Guerrero
2019-08-29 13:48:06 +02:00
parent 22c5c9444e
commit 80a0d67f15
2 changed files with 64 additions and 36 deletions

22
API.md
View File

@ -11,17 +11,35 @@ craftguide.register_craft_type("digging", {
})
```
#### Registering a custom crafting recipe (example)
#### Registering a custom crafting recipe (examples)
```Lua
craftguide.register_craft({
type = "digging",
width = 1,
output = "default:cobble 2",
result = "default:cobble 2",
items = {"default:stone"},
})
```
Recipes can also be registered in a Minecraft-like way:
```Lua
craftguide.register_craft({
grid = {
"X #",
" ## ",
"X#X#",
"X X",
},
key = {
['#'] = "default:wood",
['X'] = "default:glass",
},
result = "default:mese 3",
})
```
---
### Recipe filters