mirror of
https://github.com/minetest-mods/craftguide.git
synced 2024-11-29 13:53:43 +01:00
Small precisions
This commit is contained in:
parent
ee1eac039e
commit
c9c2bf03de
5
API.md
5
API.md
@ -5,6 +5,9 @@
|
|||||||
Custom recipes are nonconventional crafts outside the main crafting grid.
|
Custom recipes are nonconventional crafts outside the main crafting grid.
|
||||||
They can be registered in-game dynamically and have a size beyond 3x3 items.
|
They can be registered in-game dynamically and have a size beyond 3x3 items.
|
||||||
|
|
||||||
|
**Note:** the registration format differs from the default registration format in everything.
|
||||||
|
The width is automatically calculated depending where you place the commas. Look at the examples attentively.
|
||||||
|
|
||||||
#### Registering a custom crafting type (example)
|
#### Registering a custom crafting type (example)
|
||||||
|
|
||||||
```Lua
|
```Lua
|
||||||
@ -77,7 +80,7 @@ craftguide.register_craft({
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
Recipes can be registered via an URL (HTTP support is required¹):
|
Recipes can be registered from a given URL containing a JSON file (HTTP support is required¹):
|
||||||
|
|
||||||
```Lua
|
```Lua
|
||||||
craftguide.register_craft({
|
craftguide.register_craft({
|
||||||
|
1
init.lua
1
init.lua
@ -121,7 +121,6 @@ local function msg(name, str)
|
|||||||
return chat_send(name, fmt("[craftguide] %s", clr("#FFFF00", str)))
|
return chat_send(name, fmt("[craftguide] %s", clr("#FFFF00", str)))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local function is_str(x)
|
local function is_str(x)
|
||||||
return type(x) == "string"
|
return type(x) == "string"
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user