ME Bridge removes NBT data
LelouBil opened this issue ยท 3 comments
Describe
Imported items using importItem(table item, string direction)
from the ME Bridge lose their NBT data
Discovered in All The Mods 8 v1.0.8 and not reproduced in isolation, the linked video is also using ATM 8-1.0.8
UPDATE: I have reproduced it only with CC-Tweaked, AE2 and Advanced Peripherals, all using the same versions I linked below
Steps to reproduce
- Place down a ME Network (with storage)
- Place down a computer and an ME Bridge connected to the ME Network
- Place a chest next to the ME Bridge
- Use the provided program to transfer an item (with NBT data) from the chest into the ME Network (adjust chest side and item name)
local bridge = peripheral.wrap("meBridge")
local bside = "west" --adjust
bridge.importItem({name="minecraft:enchanted_book"},bside)
print(textutils.serialiseJSON(bridge.listItems[1].nbt)
- Look inside the ME Network from any other mean and extract the item
- The item lost it's NBT data.
Multiplayer?
Yes
Version
1.19.2-0.7.22b (Latest 1.19)
Minecraft, Forge and maybe other related mods versions
MC 1.19.2, Modpack : All The Mods 8 v1.0.8, Forge : 43.2.3, AE2: 12.9.2, CC-Tweaked: 1.101.1
Screenshots or Videos
https://i.imgur.com/bWCdsr1.mp4
Crashlog/log
No response
I tracked down the bug to here
https://github.com/SirEndii/AdvancedPeripherals/blob/dbb9c4377b7528d12c294555ee0e212efc7b819e/src/main/java/de/srendi/advancedperipherals/common/addons/computercraft/peripheral/MeBridgePeripheral.java#L147-L150
To create the AEItemKey, the itemstack data of the provided filter is used, not the one of the actually found item in the inventory.
In my case, I didn't have any nbt tag in the filter, so the nbt was just blank.
This can be fixed by creating a AEItemKey for each stack actually transferred.
If I had json nbt in the filter, it would get applied to the items that matched (no problem here)
And if I had nbt as a hash, it would look into ae2 in order to get the full nbt data to create the AEItemKey, but if the network doesn't have any it would just return null
https://github.com/SirEndii/AdvancedPeripherals/blob/dbb9c4377b7528d12c294555ee0e212efc7b819e/src/main/java/de/srendi/advancedperipherals/common/util/ItemUtil.java#LL99C36-L99C36
Thats not what's happening here, but this can cause nbt loss too.
The whole item transferring stuff in AP is old garbage which I need to improve in 0.8
But thank you for your contribution