Expose `nbt` from non-detailed `turtle.getItemDetail`
hugeblank opened this issue · 7 comments
Funnily enough, the issue prior to this one (#1300) narrowly misses addressing this. I believe it's a bit ridiculous that the turtlesgetItemDetail
tells less about its own inventory than the getItemDetail
for a remotely attached inventory peripheral. At the bare minimum it should provide nbt, bringing it to parity with an item in an inventory list
call. I'd argue however that perhaps a turtle.list
method should be implemented, that provides the same detail as calling list
on an inventory, and then getItemDetail
be brought to parity with its inventory counterpart.
let it be known that three people were sitting in front of a turtle like monkies in front of a typewriter trying to figure this out. Thank you for reminding us to check the documentation sometimes.
It might be possible for us to safely return the nbt
hash without running on the main thread if we change how we snapshot the turtle's inventory. Will leave this open to remind me to look at that.
turtle.getItemDetail
accepts a detailed
parameter, which reports more information (including the nbt
hash).
turtle.getItemDetail
doesn't return that by default, as it runs on the computer thread rather than the main thread, so isn't as thread safe.
I'd argue however that perhaps a turtle.list method should be implemented
@hugeblank
You can make your own implementation for this.
I made this back in the Plethora days before CC had it's own item API, so it may be out of date.
https://github.com/Lupus590-CC/CC-Random-Code/blob/master/src/turtleGenericInventoryProxy.lua#L15-L20
turtle.getItemDetail
accepts adetailed
parameter, which reports more information (including thenbt
hash).
Squid addressed that. see above.