
Converting ItemStacks to NBT then JSON causes some data loss in the case of some modded inventories.
AmandaCameron opened this issue ยท 1 comments
StorageDrawers uses some sliglty-odd behaviour for the ItemStacks returned from it's inventory, namely, they may be larger than 64.
For instance, our storage drawers currently have 286 copper ingots, which SD is reporting back to OC2, then when OC2 turns that into NBT, it's getting wrapped around as a uint8 with a value of 30.
Another case is that we have 191 paper in another drawer, which OC2 is reporting as -65 which I suspect is the uint8 value of 191 being converted to a signed int8 in the NBT, but I'm not sure on the math of that.
One solution may be to manually change the Count
field into a long
which should work for everything. I believe that the ItemStack API doesn't return an byte for size, which may be the discrepency here?