From a819b41782de9960acec6728a6235ee7c8450a8c Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Fri, 6 Dec 2019 22:17:03 -0800 Subject: [PATCH] Prevent filling up the inventory with tools. nexus blocks can still be stacked. Tested. --- mods/nodes/init.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mods/nodes/init.lua b/mods/nodes/init.lua index f7cb2a5..19b7251 100644 --- a/mods/nodes/init.lua +++ b/mods/nodes/init.lua @@ -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,