Compare commits

..

5 Commits
1.3 ... 1.3.1

3 changed files with 25 additions and 8 deletions

4
API.md
View File

@ -38,7 +38,7 @@ i3.new_tab {
Updates the current formspec. `extra_formspec` adds an additional formspec string.
#### `i3.delete_tab(tabname)`
#### `i3.remove_tab(tabname)`
Deletes a tab by name.
@ -178,7 +178,7 @@ end)
Removes all recipe filters and adds a new one.
#### `i3.delete_recipe_filter(name)`
#### `i3.remove_recipe_filter(name)`
Removes the recipe filter with the given `name`.

View File

@ -49,4 +49,4 @@ Love this mod? Donations are appreciated: https://www.paypal.me/jpg84240
Demo video (outdated): https://www.youtube.com/watch?v=25nCAaqeacU
![Preview](https://user-images.githubusercontent.com/7883281/123556172-f670a180-d789-11eb-9168-eb38fc764736.png)
![Preview](https://user-images.githubusercontent.com/7883281/123561657-10ba7780-d7aa-11eb-8bbe-dcec348bb28c.png)

View File

@ -21,7 +21,7 @@ local compress_groups, compressed = loadfile(modpath .. "/etc/compress.lua")()
local group_stereotypes, group_names = loadfile(modpath .. "/etc/groups.lua")()
local progressive_mode = core.settings:get_bool "i3_progressive_mode"
local item_compression = core.settings:get_bool "i3_item_compression"
local item_compression = core.settings:get_bool("i3_item_compression", true)
local damage_enabled = core.settings:get_bool "enable_damage"
local __3darmor, __skinsdb, __awards
@ -117,6 +117,10 @@ end
local old_is_creative_enabled = core.is_creative_enabled
function core.is_creative_enabled(name)
if name == "" then
return old_is_creative_enabled(name)
end
return check_privs(name, {creative = true}) or old_is_creative_enabled(name)
end
@ -422,7 +426,7 @@ function i3.set_recipe_filter(name, f)
recipe_filters = {[name] = f}
end
function i3.delete_recipe_filter(name)
function i3.remove_recipe_filter(name)
recipe_filters[name] = nil
end
@ -583,6 +587,8 @@ local function search(data)
local filters = {}
if search_filter then
search_filter = search_filter:trim()
for filter_name, values in gmatch(filter, sub(opt, 6)) do
if search_filters[filter_name] then
values = split(values, ",")
@ -616,7 +622,18 @@ local function search(data)
end
end
else
to_add = find(search_in, filter, 1, true)
local ok = true
for keyword in gmatch(filter, "%S+") do
if not find(search_in, keyword, 1, true) then
ok = nil
break
end
end
if ok then
to_add = true
end
end
if to_add then
@ -2207,9 +2224,9 @@ function i3.get_tabs()
return tabs
end
function i3.delete_tab(tabname)
function i3.remove_tab(tabname)
if not true_str(tabname) then
return err "i3.delete_tab: tab name missing"
return err "i3.remove_tab: tab name missing"
end
for i, def in ipairs(tabs) do