CC: Tweaked

CC: Tweaked

59M Downloads

Some item details cannot be serialised

SquidDev opened this issue ยท 0 comments

commented

Minecraft Version

1.21.x

Version

1.112.0

Details

Attempting to get the details of some items results in tables that cannot be serialised. The easiest way to reproduce this is to find an item with no lore and no creative tab, such as a command block.

local tbl = turtle.getItemDetail(1, true)
textutils.serialise(tbl) -- Errors
print(tbl.lore == tbl.itemGroups) -- true

This is effectively the same issue as #1588. I think the best option here is to identify empty objects (Set.of(), List.of(), Map.of(), maybe the Collections ones too?) and not de-duplicate them.

As an aside, we should skip adding lore if it is empty.