Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
RobertBouillon opened this issue Apr 20, 2024 · 2 comments · Fixed by #596 or #626
Open

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

RobertBouillon opened this issue Apr 20, 2024 · 2 comments · Fixed by #596 or #626
Assignees
Labels
Milestone

Comments

@RobertBouillon
Copy link

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

@RobertBouillon RobertBouillon added bug Something isn't working needs review Needs review from an Contributor labels Apr 20, 2024
@SirEndii SirEndii added this to the 0.7.x milestone Apr 26, 2024
@zyxkad
Copy link
Collaborator

zyxkad commented Apr 26, 2024

This is a breaking change and should fix in 0.8

@zyxkad zyxkad modified the milestones: 0.7.x, 0.8r Apr 26, 2024
@zyxkad zyxkad added Priority-Medium and removed needs review Needs review from an Contributor labels Apr 26, 2024
@zyxkad zyxkad self-assigned this Apr 26, 2024
zyxkad added a commit to zyxkad/AdvancedPeripherals that referenced this issue Apr 27, 2024
@zyxkad zyxkad linked a pull request Apr 27, 2024 that will close this issue
3 tasks
@github-project-automation github-project-automation bot moved this from Todo to Done in Advanced Peripherals Jun 3, 2024
@SirEndii
Copy link
Member

SirEndii commented Jun 3, 2024

Reopen until released

@SirEndii SirEndii reopened this Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: To Be Released
3 participants