[Issue] rsBridge.getItem() doesn't work
Xenxes opened this issue ยท 5 comments
Describe
if item doesn't exist in RS storage, getItem returns nil
but if item exists - returns java.lang.NullPointerException
Reproduce
Steps to reproduce the behavior:
- Connect RS Bridge to CC, RS
- Execute in lua interpreter
peripheral.find('rsBridge').getItem({ name = 'minecraft:granite' })
- Returns
nil
- Add vanilla minecraft "Granite" to RS network
- Execute same script
- Returns
java.lang.NullPointerException
Versions:
- Forge version: 36.1.13
- AdvancedPeripherals version: 0.6r
- Refined Storage version: 1.9.12
[ComputerCraft-Coroutine-0/ERROR]: Error calling call on dan200.computercraft.core.apis.PeripheralAPI@18bda158
java.lang.NullPointerException: null
at de.srendi.advancedperipherals.common.addons.refinedstorage.RefinedStorage.getItem(RefinedStorage.java:173) ~[?:0.6r]
at de.srendi.advancedperipherals.common.addons.computercraft.peripheral.RsBridgePeripheral.getItem(RsBridgePeripheral.java:231) ~[?:0.6r]
at de.srendi.advancedperipherals.common.addons.computercraft.peripheral.RsBridgePeripheral$cc$getItem37.apply(CC generated method) ~[?:?]
at dan200.computercraft.shared.peripheral.modem.wired.WiredModemPeripheral$RemotePeripheralWrapper.callMethod(WiredModemPeripheral.java:350) ~[?:1.96.0]
at dan200.computercraft.shared.peripheral.modem.wired.WiredModemPeripheral.callRemote(WiredModemPeripheral.java:177) ~[?:1.96.0]
at dan200.computercraft.shared.peripheral.modem.wired.WiredModemPeripheral$cc$callRemote29.apply(CC generated method) ~[?:?]
at dan200.computercraft.core.apis.PeripheralAPI$PeripheralWrapper.call(PeripheralAPI.java:105) ~[?:1.96.0]
at dan200.computercraft.core.apis.PeripheralAPI.call(PeripheralAPI.java:338) ~[?:1.96.0]
at dan200.computercraft.core.apis.PeripheralAPI$cc$call104.apply(CC generated method) ~[?:?]
at dan200.computercraft.core.lua.ResultInterpreterFunction.invoke(ResultInterpreterFunction.java:58) [?:1.96.0]
at org.squiddev.cobalt.function.ResumableVarArgFunction.invoke(ResumableVarArgFunction.java:77) [?:1.96.0]
at org.squiddev.cobalt.function.LuaInterpreter.execute(LuaInterpreter.java:491) [?:1.96.0]
at org.squiddev.cobalt.function.LuaInterpretedFunction.invoke(LuaInterpretedFunction.java:149) [?:1.96.0]
at org.squiddev.cobalt.OperationHelper.invoke(OperationHelper.java:486) [?:1.96.0]
at org.squiddev.cobalt.OperationHelper.invoke(OperationHelper.java:481) [?:1.96.0]
at org.squiddev.cobalt.lib.BaseLib.pcall(BaseLib.java:436) [?:1.96.0]
at org.squiddev.cobalt.lib.BaseLib.access$500(BaseLib.java:59) [?:1.96.0]
at org.squiddev.cobalt.lib.BaseLib$BaseLibR.invoke(BaseLib.java:334) [?:1.96.0]
at org.squiddev.cobalt.function.ResumableVarArgFunction.invoke(ResumableVarArgFunction.java:77) [?:1.96.0]
at org.squiddev.cobalt.OperationHelper.invoke(OperationHelper.java:486) [?:1.96.0]
at org.squiddev.cobalt.function.LuaInterpreter.execute(LuaInterpreter.java:403) [?:1.96.0]
at org.squiddev.cobalt.function.LuaInterpretedFunction.resume(LuaInterpretedFunction.java:196) [?:1.96.0]
at org.squiddev.cobalt.debug.DebugFrame.resume(DebugFrame.java:243) [?:1.96.0]
at org.squiddev.cobalt.LuaThread.loop(LuaThread.java:566) [?:1.96.0]
at org.squiddev.cobalt.LuaThread$1.run(LuaThread.java:463) [?:1.96.0]
at dan200.computercraft.core.lua.CobaltLuaMachine.lambda$null$1(CobaltLuaMachine.java:79) [?:1.96.0]
at dan200.computercraft.core.lua.CobaltLuaMachine$$Lambda$29150/930696335.run(Unknown Source) [?:1.96.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_51]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_51]
advancedperipherals-0.6.1b.zip
Hey, could you try it with this version?
Unzip the file before you use it.
getItem()
works
but now this code doesn't work:
peripheral.find('rsBridge').exportItemToChest({name='minecraft:stone', count=3}, peripheral.getName(peripheral.find('minecraft:chest')))
64 'minecraft:stone' in RS network
function returns 0
chest is empty
hmm
it's interesting
if i craft item, this code works
peripheral.find('rsBridge').craftItem({name='minecraft:stone', count=3})
peripheral.find('rsBridge').exportItemToChest({name='minecraft:stone', count=3}, peripheral.getName(peripheral.find('minecraft:chest')))