RS Bridge return incorrect item "amount" and "isCraftable"
Describe
Calling getItem with RS Bridge to a craftable item with 0 units in the system, it returns an incorrect amount of stored items and an invalid "craftable" status (check repro steps and screenshots below).
Steps to reproduce
- Using RS, connect to the same network: "Creative Controller", "Grid", "Pattern Grid", "Crafting Monitor", "Crafter Manager", "Crafter", a couple of Chests with "External storage"s.
- Put inside the chests 64 "Oak Planks".
- Create a Pattern to craft an "Oak Door" and place the pattern in the Crafter.
- Connect the RS Bridge to the network and to a computer.
- Run this script:
function dump(o)
if type(o) == 'table' then
local s = '{ '
for k,v in pairs(o) do
if type(k) ~= 'number' then k = '"'..k..'"' end
s = s .. '['..k..'] = ' .. dump(v) .. ','
end
return s .. '} '
else
return tostring(o)
end
end
local rsBridge = peripheral.find("rsBridge") or peripheral.find("rs_bridge")
local itemData = rsBridge.getItem({ name = "minecraft:oak_door" })
print(dump(itemData))
- Notice that it says "amount" = 3, and "isCraftable" = false, but you have 0 "Oak Doors" in the system and they can can be crafted.
Multiplayer?
Yes
Version
1.20.4-0.7.43a (Latest 1.20.4)
Minecraft, Forge and maybe other related mods versions
Forge 47.4.0 - Minecraft 1.20.1
Screenshots or Videos
No response
Crashlog/log
No response
This is still an issue.
Minecraft 1.20.1 Forge Mod Loader 47.4.0 Advanced Peripherals 0.7.45r Computercraft: Tweaked 1.116.1 Refined Storage 1.12.4
Test code:
local rs = peripheral.wrap("rsBridge_0")
local item = {name = "minecraft:diamond"}
local pretty = require("cc.pretty")
local item_data = rs.getItem(item)
local isCraftable = rs.isItemCraftable(item)
if item_data then
print("//// Get Item ////")
print("Amount: "..item_data.amount)
print("Craftable: "..(item_data.isCraftable and "true" or "false"))
else
printError("No item details.")
end
print("")
print(isCraftable and "Pattern detected" or "No pattern in system for this item")
With 0 minecraft:diamonds in the system, and a pattern for crafting 9 diamonds from a block, the following output is observed:
The RS Bridge has incorrectly stated there are 9 diamonds present in the system, when there is in fact 0 diamonds in the system. The getItem method also incorrectly states that the item is not craftable, despite isItemCraftable indicating there is a pattern for the item.
When the item exists in the system, the amount field reports the correct number of items, however the isCraftable field is still incorrect in getItem.