Implement item blacklisting for team chests

This commit is contained in:
ClobberXD 2018-10-18 02:54:25 +05:30 committed by rubenwardy
parent b30ea671e4
commit f8a6b64627

View file

@ -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