From f8a6b6462721484a9619625a544c418e5ac1f6cf Mon Sep 17 00:00:00 2001 From: ClobberXD Date: Thu, 18 Oct 2018 02:54:25 +0530 Subject: [PATCH] Implement item blacklisting for team chests --- mods/ctf_team_base/chest.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/mods/ctf_team_base/chest.lua b/mods/ctf_team_base/chest.lua index f6b28a2..87306f2 100644 --- a/mods/ctf_team_base/chest.lua +++ b/mods/ctf_team_base/chest.lua @@ -1,3 +1,15 @@ +local blacklist = { + "default:pick_wood", + "default:axe_wood", + "default:shovel_wood", + "default:sword_wood", + "default:leaves", + "default:jungleleaves", + "default:pine_needles", + "default:acacia_leaves", + "default:aspen_leaves" +} + local function max(a, b) return (a > b) and a or b end @@ -112,6 +124,12 @@ for _, chest_color in pairs(colors) do return 0 end + for itemstring in ipairs(blacklist) do + if stack:get_name() == itemstring then + return 0 + end + end + local pstat = ctf_stats.player(player:get_player_name()) if not pstat or not pstat.score or pstat.score < 10 then return 0