From c30b69fd9ce1fb208362d0b291fbe92da0b0791e Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Fri, 1 Jan 2021 20:23:42 +0100 Subject: [PATCH] Fix compress/sort --- init.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 96aadf9..a7cfd96 100644 --- a/init.lua +++ b/init.lua @@ -877,9 +877,10 @@ local function sort_itemlist(player, az) local count = stack:get_count() local empty = stack:is_empty() local meta = stack:get_meta():to_table() + local wear = stack:get_wear() > 0 if not empty then - if next(meta.fields) then + if next(meta.fields) or wear then stack_meta[#stack_meta + 1] = stack else new_inv[#new_inv + 1] = sprintf("%s %u", name, count) @@ -912,9 +913,10 @@ local function compress_items(player) local count = stack:get_count() local empty = stack:is_empty() local meta = stack:get_meta():to_table() + local wear = stack:get_wear() > 0 if not empty then - if next(meta.fields) then + if next(meta.fields) or wear then stack_meta[#stack_meta + 1] = stack else new_inv[name] = new_inv[name] or 0