diff --git a/README.md b/README.md index 26f345d..6d0e87d 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/src/api.lua b/src/api.lua index 47f242b..8e84077 100644 --- a/src/api.lua +++ b/src/api.lua @@ -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)