forked from minetest-mods/craftguide
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)
|
||||
```
|
||||
|
||||
#### `craftguide.set_recipe_filter(name, function(recipe, player))`
|
||||
|
||||
Removes all recipe filters and adds a new one.
|
||||
|
||||
#### `craftguide.remove_recipe_filter(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
|
||||
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)
|
||||
recipe_filters[name] = nil
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user