Skip to content

Slot indices are 0-based instead of 1-based #587

Closed
@RobertBouillon

Description

@RobertBouillon

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

image

  1. Connect an ME Bridge and vanilla chest to a wired network
  2. Create an ME system with item storage and connect it to the ME Bridge
  3. Place items in the first and second slots of the chest
  4. 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

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions