Error with NBT.from_tag_list
on map
ed NBT list with empty object
#1315
Labels
NBT.from_tag_list
on map
ed NBT list with empty object
#1315
Issue type:
Short description:
map
ing a list of items withitemNBT
yields a list of NBT, with items that have no NBT having empty NBT (rather than an empty NBT object like{}
).This conversation is trying to provide the item NBT of an inventory to CC via a compat mod, and is trying to make an NBT list as the final output rather than a list of NBT.
Empty NBT elements seem to be removed when using
NBT.from_tag_list
(unknown if this is intended - expected behaviour would have been to have the empty NBT elements be present in the NBT list as well), which would be an issue as the entry for that item would then be missing from the CC side, so an operator that yields an empty NBT object for items that don't have NBT was made and used.However, this new list of NBT causes
NBT.from_tag_list
to error.Steps to reproduce the problem:
(see the expected behaviour section for a potentially simpler setup to reproduce the same error - they seem like they're caused by the same bug but I'm not sure so this reproduction section uses these steps because they were the original bug report)
map
usingitemNBT
and then useNBT.from_tag_list
on the list - should output and NBT list (see the top 2 display panels of the image below)map
using theitemNBTorEmptyObject
operator defined below and then useNBT.from_tag_list
on the list - results in an error (see the bottom right 2 display panels of the image below, and the error message)Expected behaviour:
Step 3 does not error.
Note that using
NBT.from_tag_list
on the manually defined list of NBT[{}]
produces the NBT list[{}]
as expected, rather than an error.However, making an
Any
list,append
ing"{}" :: NBT
to it (giving[{}]
like before, but with anAny
list rather than anNBT
list), and then usingNBT.from_tag_list
on it results in the same error as before instead of[{}]
as expected.Having a look at the source code, it seems like in
IntegratedDynamics/src/main/java/org/cyclops/integrateddynamics/core/helper/NbtHelpers.java
Lines 157 to 172 in 67e5487
value
(which seems like it would be the list's value itself) rather than ever usingvalueNbt
(which seems like it would be the value of a given element in the list) - I'm unsure if that's intended but it might be a cause of this behaviour.Versions:
Log file:
N/A
The text was updated successfully, but these errors were encountered: