From 7ab8825460ad26a4697fec52a11c864a6cddde63 Mon Sep 17 00:00:00 2001 From: ForbiddenJ Date: Wed, 1 Mar 2017 16:28:40 -0600 Subject: Make trash configurable but preserve default functionality --- bags.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'bags.lua') diff --git a/bags.lua b/bags.lua index 4af4ff5..3923dab 100644 --- a/bags.lua +++ b/bags.lua @@ -51,8 +51,11 @@ for i = 1, 4 do elseif slots == 24 then formspec = formspec.."background[0.06,0.99;7.92,7.52;ui_bags_lg_form.png]" end - formspec = (formspec.."background[6.06,0;0.92,0.92;ui_bags_trash.png]" - .."list[detached:trash;main;6,0.1;1,1;]") + local player_name = player:get_player_name() -- For if statement. + if unified_inventory.trash_enabled or unified_inventory.is_creative(player_name) or minetest.get_player_privs(player_name).give then + formspec = (formspec.."background[6.06,0;0.92,0.92;ui_bags_trash.png]" + .."list[detached:trash;main;6,0.1;1,1;]") + end return {formspec=formspec} end, }) -- cgit v1.2.3