mirror of
https://github.com/minetest-mods/craftguide.git
synced 2024-11-26 12:33:43 +01:00
Re-add accidentally removed
This commit is contained in:
parent
29f87f2607
commit
07820fa37c
4
API.md
4
API.md
@ -82,6 +82,10 @@ craftguide.add_recipe_filter("Hide secretstuff", function(recipes)
|
|||||||
end)
|
end)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### `craftguide.set_recipe_filter(name, function(recipe, player))`
|
||||||
|
|
||||||
|
Removes all recipe filters and adds a new one.
|
||||||
|
|
||||||
#### `craftguide.remove_recipe_filter(name)`
|
#### `craftguide.remove_recipe_filter(name)`
|
||||||
|
|
||||||
Removes the recipe filter with the given name.
|
Removes the recipe filter with the given name.
|
||||||
|
10
init.lua
10
init.lua
@ -251,6 +251,16 @@ function craftguide.add_recipe_filter(name, f)
|
|||||||
recipe_filters[name] = f
|
recipe_filters[name] = f
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function craftguide.set_recipe_filter(name, f)
|
||||||
|
if not is_str(name) then
|
||||||
|
return err("craftguide.set_recipe_filter(): name missing")
|
||||||
|
elseif not is_func(f) then
|
||||||
|
return err("craftguide.set_recipe_filter(): function missing")
|
||||||
|
end
|
||||||
|
|
||||||
|
recipe_filters = {[name] = f}
|
||||||
|
end
|
||||||
|
|
||||||
function craftguide.remove_recipe_filter(name)
|
function craftguide.remove_recipe_filter(name)
|
||||||
recipe_filters[name] = nil
|
recipe_filters[name] = nil
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user