Prevent filling up the inventory with tools.

nexus blocks can still be stacked. Tested.
This commit is contained in:
Auke Kok 2019-12-06 22:17:03 -08:00
parent b38334d484
commit a819b41782

View File

@ -1440,7 +1440,13 @@ for _, names in ipairs({
itemstack:add_item(name)
return itemstack
end
clicker:get_inventory():add_item("main", name)
local inv = clicker:get_inventory()
-- prevent stacking of tools, but not nexus blocks.
if name == "boxes:nexus" then
inv:add_item("main", name)
elseif not inv:contains_item("main", name) then
inv:add_item("main", name)
end
end
return itemstack
end,