keep items w/ wear or items w/ max stacksize=1 from going into warehouses

This commit is contained in:
flux 2020-05-09 21:40:20 +00:00
parent 49352529e4
commit 10409987f0

@ -206,6 +206,10 @@ end
function techpack_warehouse.allow_metadata_inventory_put(self, pos, listname, index, stack, player) function techpack_warehouse.allow_metadata_inventory_put(self, pos, listname, index, stack, player)
if minetest.is_protected(pos, player:get_player_name()) then if minetest.is_protected(pos, player:get_player_name()) then
return 0 return 0
elseif stack:get_wear() ~= 0 then
return 0
elseif stack:get_stack_max() == 1 then
return 0
end end
local inv = M(pos):get_inventory() local inv = M(pos):get_inventory()
local main_stack = inv:get_stack("main", index) local main_stack = inv:get_stack("main", index)