Slot indices are 0-based instead of 1-based
RobertBouillon opened this issue ยท 2 comments
Describe
Slot filter arguments start at index 0 instead of 1. Lua indices are 1-based, so it makes it difficult to write code that interoperates with the peripheral API.
Indices should be 1-based to be consistent with Lua and CC:T standards.
Steps to reproduce
- Connect an ME Bridge and vanilla chest to a wired network
- Create an ME system with item storage and connect it to the ME Bridge
- Place items in the first and second slots of the chest
- Run the following code;
local chestName = "left"
local chest = peripheral.wrap(chestName)
local bridge = peripheral.wrap("right")
for slot in pairs(chest.list())
bridge.importItemFromPeripheral({fromSlot=slot},chestName))
end
Expected Results
All items are moved from the chest into the ME system
Actual Results
Slot 0 still contains the original item
Workaround
Reduce the indices sent to the ME Bridge by 1
Multiplayer?
Yes
Version
1.19.2-0.7.34r (Latest 1.19.2)
Minecraft, Forge and maybe other related mods versions
1.19.2 / Skies Expert
Screenshots or Videos
No response
Crashlog/log
No response