OpenMods / OpenPeripheral

https://openmods.info
MIT License
67 stars 25 forks source link

Deep Storage Unit compat broken with e.g. pushItemIntoSlot #153

Open ghost opened 10 years ago

ghost commented 10 years ago

getInventorySize returns 3, however trying to push into slots 0, 1, 2, and 3 fails.

Unless I'm doing something wrong, dsu compatibility is broken.

nevercast commented 10 years ago

Slots start from 0, So slots 0, 1 and 2 are a total of 3 slots. Please confirm that you can push in to slot 0 as well as 1 and 2. Cheers.

dmarcuse commented 10 years ago

One of the slots (2 maybe) is output only. The other two are input only and should only accept the type of item already contained within the DSU, or all items if the DSU is empty.

nevercast commented 10 years ago

This is also a possibility, though does push not return false instead of an error if this is the case ? It has been far too long since I've experimented with OpenP and things may have changed. Though I do believe the issue is an index one. There are only 3 slots, and it starts from 0. (Unlike Lua that is 1-based)

ghost commented 10 years ago

I tried slots 0-3. None worked. Might have been fixed in a newer OP version, but I can't test.

theoriginalbit commented 10 years ago

@nevercast what are you talking about... we do a -- on numbers from Lua, so if they want to access slots 0-2 they need to use the numbers 1-3 in Lua...

nevercast commented 10 years ago

I had assumed that the methods would use Java convention and we would have a proxy method that would make these adjustments. Following this assumption I also assumed that the API was being used directly, instead of through Lua. Disregard my comments.