Implement item blacklisting for team chests
This commit is contained in:
parent
b30ea671e4
commit
f8a6b64627
1 changed files with 18 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue