Skip to content
This repository has been archived by the owner on Sep 19, 2022. It is now read-only.

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
loosewheel committed Sep 18, 2022
1 parent ef1c561 commit 9265380
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions storage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,6 @@ local function get_formspec_list (pos)
list[#list + 1] =
{
item = k,
name = stack:get_name (),
description = utils.unescape_description (description),
count = v.count
}
Expand All @@ -756,6 +755,20 @@ end



local function item_to_string_stripped (stack)
local t = ItemStack (stack):to_table ()
local palette_index = (t.meta and t.meta.palette_index)

t.meta = nil
if palette_index then
t.meta = { palette_index = palette_index }
end

return ItemStack (t):to_string ()
end



local function indexer_get_formspec (pos, search)
local inv_list = get_formspec_list (pos)

Expand Down Expand Up @@ -786,7 +799,8 @@ local function indexer_get_formspec (pos, search)

local item =
string.format ("item_image_button[0.0,%0.2f;1.0,1.0;%s;01_%d;]",
top, minetest.formspec_escape(v.name), item_index)
top, minetest.formspec_escape (item_to_string_stripped (v.item)),
item_index)

if max_stack >= 10 then
item = item..
Expand Down

0 comments on commit 9265380

Please sign in to comment.