Tags and the recipe event
zehmaria opened this issue ยท 1 comments
Minecraft Version
1.18.2
KubeJS Version
1802.5.1-build.345
Rhino Version
1801.1.9-build.135
Architectury Version
4.2.50
Forge/Fabric Version
Forge 40.1.0
Describe your issue
java.lang.ArrayIndexOutOfBoundsException Error when using event.shaped with only tags as ingredients.
So something like this: event.shaped('minecraft:stick', [['#minecraft:logs','#minecraft:logs']]);
Will fail on start. But it will work on reload. This follows the same pattern as in #313.
My guess: before, the context of that function already knew every item in each tag. [1.16.5 is my experience]. Which isn't the case anymore. So, each "#tag:tag" expression is considered an empty tag up to the first load being completed. [as per some discord message, it seems the tags are loaded first but not bound somehow].
In the event.shaped: an empty tag is not considered a fatal error if the recipe without it is still valid [it becomes a space/air as a fallback]. So, anything with at least one "item:item" in passes. Then, they are reevaluated later to fit the actual items in the tag. But, if there are just tags, the function will throw the error thinking the recipe is empty since it just doesn't know when "#tag:tag" is not empty.
Expectations:
- That part of the code needs to know the elements of each tag
or - The Error-Catching needs to be updated to reflect the change.
Crash report/logs
No response