Nbt Crafting (Fabric)

Nbt Crafting (Fabric)

630k Downloads

[bug] custom attributes not working in nbt dollar merging

ZombieNW opened this issue ยท 1 comments

commented

Version
1.16.5 v2.0.6
Describe the bug
When using dollars to merge NBT in an anvil(haven't tested it on other recipe types), Item Attributes(like when in main hand do blank) cause the entire recipe to cease to function.

To Reproduce

  1. Use this json or craft something.
    { "type": "nbtcrafting:anvil", "base": { "item": "minecraft:diamond_boots" }, "ingredient": { "item": "minecraft:enchanted_book", "data":{ "speedEnchant":1 } }, "result": { "item": "minecraft:diamond_boots", "data": { "$": "$ base", "Enchantments": [{}], "speedEnchant":1, "display": { "Lore": ["{\"text\":\"Speed I\",\"color\":\"gray\",\"italic\":false}"] } } }, "levels": 3 }
  2. Bug appears

Expected behavior
The expected result is to have the custom armor (made using custom model data and attributes) from my datapack be able to have the custom enchant from above.

Log
The important parts of the log.
[16:20:51] [Server thread/FATAL]: Error executing task on Server net.minecraft.class_148: Container click at net.minecraft.class_1703.method_7593(class_1703.java:187) ~[intermediary-server.jar:?] at net.minecraft.class_3244.method_12076(class_3244.java:1373) ~[intermediary-server.jar:?] at net.minecraft.class_2813.method_12191(class_2813.java:32) ~[intermediary-server.jar:?] at net.minecraft.class_2813.method_11054(class_2813.java:10) ~[intermediary-server.jar:?] at net.minecraft.class_2600.method_11072(class_2600.java:21) ~[intermediary-server.jar:?] at net.minecraft.class_3738.run(class_3738.java:18) ~[intermediary-server.jar:?] at net.minecraft.class_1255.method_18859(class_1255.java:144) ~[intermediary-server.jar:?] at net.minecraft.class_4093.method_18859(class_4093.java:23) ~[intermediary-server.jar:?] at net.minecraft.server.MinecraftServer.method_24306(MinecraftServer.java:761) ~[intermediary-server.jar:?] at net.minecraft.server.MinecraftServer.method_18859(MinecraftServer.java:155) ~[intermediary-server.jar:?] at net.minecraft.class_1255.method_16075(class_1255.java:118) ~[intermediary-server.jar:?] at net.minecraft.server.MinecraftServer.method_20415(MinecraftServer.java:743) ~[intermediary-server.jar:?] at net.minecraft.server.MinecraftServer.method_16075(MinecraftServer.java:737) ~[intermediary-server.jar:?] at net.minecraft.class_1255.method_5383(class_1255.java:103) ~[intermediary-server.jar:?] at net.minecraft.server.MinecraftServer.method_16208(MinecraftServer.java:721) ~[intermediary-server.jar:?] at net.minecraft.server.MinecraftServer.handler$zmg000$modifiedRunLoop(MinecraftServer.java:3819) ~[intermediary-server.jar:?] at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:651) ~[intermediary-server.jar:?] at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:257) ~[intermediary-server.jar:?] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_282] Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 at java.util.ArrayList.rangeCheck(ArrayList.java:659) ~[?:1.8.0_282] at java.util.ArrayList.get(ArrayList.java:435) ~[?:1.8.0_282] at net.minecraft.class_2499.method_10534(class_2499.java:239) ~[intermediary-server.jar:?] at net.minecraft.class_2499.get(class_2499.java:19) ~[intermediary-server.jar:?] at de.siphalor.nbtcrafting.api.nbt.NbtUtil.mergeInto(NbtUtil.java:413) ~[nbtcrafting-2.0.6+mc1.16.4.jar:?] at de.siphalor.nbtcrafting.api.nbt.NbtUtil.mergeInto(NbtUtil.java:381) ~[nbtcrafting-2.0.6+mc1.16.4.jar:?] at de.siphalor.nbtcrafting.dollar.type.MergeDollar.apply(MergeDollar.java:51) ~[nbtcrafting-2.0.6+mc1.16.4.jar:?] at de.siphalor.nbtcrafting.api.RecipeUtil.applyDollars(RecipeUtil.java:119) ~[nbtcrafting-2.0.6+mc1.16.4.jar:?] at de.siphalor.nbtcrafting.recipe.IngredientRecipe.method_8116(IngredientRecipe.java:75) ~[nbtcrafting-2.0.6+mc1.16.4.jar:?] at net.minecraft.class_1706.handler$zbm000$updateResult(class_1706.java:564) ~[intermediary-server.jar:?] at net.minecraft.class_1706.method_24928(class_1706.java) ~[intermediary-server.jar:?] at net.minecraft.class_4861.method_7609(class_4861.java:80) ~[intermediary-server.jar:?] at net.minecraft.class_4861$1.method_5431(class_4861.java:26) ~[intermediary-server.jar:?] at net.minecraft.class_1277.method_5447(class_1277.java:136) ~[intermediary-server.jar:?] at net.minecraft.class_1735.method_7673(class_1735.java:82) ~[intermediary-server.jar:?] at net.minecraft.class_1703.method_30010(class_1703.java:298) ~[intermediary-server.jar:?] at net.minecraft.class_1703.method_7593(class_1703.java:177) ~[intermediary-server.jar:?] ... 18 more

Additional context
Add any other context about the problem here.

We made a custom enchant book by giving an enchant book lore and speedEnchant tag, but then when we put it on armor that has a custom attribute, it logs that in the console and doesn't give the expected output.

Thank you

commented

forgot to mention, i just posted the recipe for diamond boots, but the custom armor is diamond boots with attributes, it works without the attributes but not with it