ComputerCraft
ComputerCraft copied to clipboard
Fix InventoryUtil ignoring the stack limit when extracting items
Using turtle.suck
on an inventory filled with tools would fill the entire chest with said item, rather than extracting a single item. In order to avoid that, we clamp the extract limit to the max stack size when first extracting an item.
This also inlines the makeSlotList
logic, which means we can avoid creating an array for each inventory operation. This probably won't have any meaningful performance impact (even on large inventories), but is a nice optimisation to make.