Additional check in API
This commit is contained in:
parent
22bfbf1f56
commit
9afbee72ce
|
@ -1,6 +1,6 @@
|
|||
# i3
|
||||
|
||||
[![ContentDB](https://content.minetest.net/packages/jp/i3/shields/title/)](https://content.minetest.net/packages/jp/i3/) [![ContentDB](https://content.minetest.net/packages/jp/i3/shields/downloads/)](https://content.minetest.net/packages/jp/i3/) ![workflow](https://github.com/minetest-mods/i3/actions/workflows/luacheck.yml/badge.svg)
|
||||
[![ContentDB](https://content.minetest.net/packages/jp/i3/shields/downloads/)](https://content.minetest.net/packages/jp/i3/) ![workflow](https://github.com/minetest-mods/i3/actions/workflows/luacheck.yml/badge.svg)
|
||||
|
||||
#### **`i3`** is a next-generation inventory for Minetest.
|
||||
|
||||
|
|
|
@ -302,6 +302,8 @@ function i3.add_sorting_method(def)
|
|||
return err "i3.add_sorting_method: name missing"
|
||||
elseif not is_func(def.func) then
|
||||
return err "i3.add_sorting_method: function missing"
|
||||
elseif i3.compressed[def.name] then
|
||||
return err(fmt("i3.add_sorting_method: item '%s' is already compressed", def.name))
|
||||
end
|
||||
|
||||
insert(i3.sorting_methods, def)
|
||||
|
|
Ŝarĝante…
Reference in New Issue