Item template components don't allow lists as specified in the wiki.
xevira opened this issue ยท 0 comments
As stated in the wiki for Item template Components:
Advanced usage of this value is possible. You may use ore:ORENAME, to display all items matching
the ore dictionary key ORENAME, or you may display multiple stacks at once by separating them with
commas (e.g. minecraft:diamond,minecraft:emerald). In both cases, they alternate with time.
I make a template that has the following item component and subsequent page usage:
{
"type": "item",
"item": "#ingredient",
"x": 48,
"y": 24
},
"ingredient": "minecraft:black_bed,minecraft:blue_bed,minecraft:brown_bed,minecraft:cyan_bed,minecraft:gray_bed,minecraft:green_bed,minecraft:light_blue_bed,minecraft:light_gray_bed,minecraft:lime_bed,minecraft:magenta_bed,minecraft:orange_bed,minecraft:pink_bed,minecraft:purple_bed,minecraft:red_bed,minecraft:white_bed,minecraft:yellow_bed",
What I imagine is the relevant part of the stack trace:
Caused by: net.minecraft.util.ResourceLocationException: Non [a-z0-9/._-] character in path of location: minecraft:black_bed,minecraft
at net.minecraft.util.ResourceLocation.<init>(ResourceLocation.java:33) ~[forge-1.16.4-35.0.18_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading}
at net.minecraft.util.ResourceLocation.<init>(ResourceLocation.java:42) ~[forge-1.16.4-35.0.18_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading}
at vazkii.patchouli.common.util.ItemStackUtil.loadStackFromString(ItemStackUtil.java:71) ~[Patchouli-1.16.2-47_mapped_snapshot_20201028-1.16.3.jar:1.16.2-47] {re:classloading}
at vazkii.patchouli.client.book.template.variable.ItemStackVariableSerializer.fromJson(ItemStackVariableSerializer.java:18) ~[Patchouli-1.16.2-47_mapped_snapshot_20201028-1.16.3.jar:1.16.2-47] {re:classloading}
at vazkii.patchouli.client.book.template.variable.ItemStackVariableSerializer.fromJson(ItemStackVariableSerializer.java:11) ~[Patchouli-1.16.2-47_mapped_snapshot_20201028-1.16.3.jar:1.16.2-47] {re:classloading}
at vazkii.patchouli.client.book.template.variable.Variable.as(Variable.java:36) ~[Patchouli-1.16.2-47_mapped_snapshot_20201028-1.16.3.jar:1.16.2-47] {re:classloading}
at vazkii.patchouli.client.book.template.component.ComponentItemStack.lambda$onVariablesAvailable$0(ComponentItemStack.java:40) ~[Patchouli-1.16.2-47_mapped_snapshot_20201028-1.16.3.jar:1.16.2-47] {re:classloading}
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) ~[?:?] {}
at java.util.stream.Streams$StreamBuilderImpl.forEachRemaining(Streams.java:411) ~[?:?] {}
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[?:?] {}
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[?:?] {}
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) ~[?:?] {}
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?] {}
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) ~[?:?] {}
at vazkii.patchouli.client.book.template.component.ComponentItemStack.onVariablesAvailable(ComponentItemStack.java:40) ~[Patchouli-1.16.2-47_mapped_snapshot_20201028-1.16.3.jar:1.16.2-47] {re:classloading}
at vazkii.patchouli.client.book.template.VariableAssigner.assignVariableHolders(VariableAssigner.java:46) ~[Patchouli-1.16.2-47_mapped_snapshot_20201028-1.16.3.jar:1.16.2-47] {re:classloading}
at vazkii.patchouli.client.book.template.TemplateComponent.compile(TemplateComponent.java:49) ~[Patchouli-1.16.2-47_mapped_snapshot_20201028-1.16.3.jar:1.16.2-47] {re:classloading}
at vazkii.patchouli.client.book.template.BookTemplate.compile(BookTemplate.java:112) ~[Patchouli-1.16.2-47_mapped_snapshot_20201028-1.16.3.jar:1.16.2-47] {re:classloading}
at vazkii.patchouli.client.book.page.PageTemplate.build(PageTemplate.java:23) ~[Patchouli-1.16.2-47_mapped_snapshot_20201028-1.16.3.jar:1.16.2-47] {re:classloading}
at vazkii.patchouli.client.book.BookEntry.build(BookEntry.java:221) ~[Patchouli-1.16.2-47_mapped_snapshot_20201028-1.16.3.jar:1.16.2-47] {re:classloading}
at vazkii.patchouli.client.book.BookContents.lambda$reload$5(BookContents.java:139) ~[Patchouli-1.16.2-47_mapped_snapshot_20201028-1.16.3.jar:1.16.2-47] {re:classloading}
... 31 more
I did notice in the repo that there were two parsing functions, one for just one itemstack definition and another that allows for lists of itemstacks. If I'm doing something wrong to make it not reference the list parsing, let me know.