Artisan Worktables 1.12

Artisan Worktables 1.12

3M Downloads

Improve error reporting when a recipe copy fails

Bulldog83 opened this issue ยท 2 comments

commented

Hello. I have an error in crafttweaker log file, but I don't know which script this from. There is in the postinit log part.
Can you tell me, please, how to localize this error?

CraftTweaker2-1.12-4.1.19
ArtisanWorktables-1.12.2-1.21.7

[POSTINITIALIZATION][CLIENT][ERROR] Unable to copy and register recipe
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
	at java.util.ArrayList.rangeCheck(ArrayList.java:653)
	at java.util.ArrayList.get(ArrayList.java:429)
	at net.minecraft.util.NonNullList.get(SourceFile:44)
	at com.codetaylor.mc.artisanworktables.modules.worktables.recipe.copy.RecipeBuilderCopyHelper.copyShapedRecipeInput(RecipeBuilderCopyHelper.java:51)
	at com.codetaylor.mc.artisanworktables.modules.worktables.recipe.copy.RecipeBuilderCopyHelper.copyRecipeInput(RecipeBuilderCopyHelper.java:28)
	at com.codetaylor.mc.artisanworktables.modules.worktables.recipe.copy.RecipeBuilderCopyStrategyBase.doCopy(RecipeBuilderCopyStrategyBase.java:138)
	at com.codetaylor.mc.artisanworktables.modules.worktables.recipe.copy.RecipeBuilderCopyStrategyByOutput.apply(RecipeBuilderCopyStrategyByOutput.java:56)
	at com.codetaylor.mc.artisanworktables.modules.worktables.integration.crafttweaker.CTRecipeAdditionQueue.on(CTRecipeAdditionQueue.java:46)
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_463_CTRecipeAdditionQueue_on_Pre.invoke(.dynamic)
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
	at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
	at crafttweaker.mc1120.CraftTweaker.onPostInit(CraftTweaker.java:131)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:637)
	at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)
	at com.google.common.eventbus.EventBus.post(EventBus.java:217)
	at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:219)
	at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:197)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)
	at com.google.common.eventbus.EventBus.post(EventBus.java:217)
	at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:136)
	at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:749)
	at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:336)
	at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:535)
	at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:3931)
	at net.minecraft.client.main.Main.main(SourceFile:123)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
commented

With the information provided, I can tell that AW is having a problem copying a shaped recipe. It isn't a problem with the CrT syntax, but a problem with the recipe being copied. I can tell that there is an attempt to retrieve data from an empty array. Inspecting RecipeBuilderCopyHelper.java:51 reveals that the recipe being copied has a defined width and height, but returns absolutely no ingredients when recipe.getIngredients() is called.

I'm going to look into providing better error reporting when this happens.

In the interim, you can try disabling half of the recipes. If the error disappears, you know which half contains the bad recipe. Then disable half of those recipes. Keep doing that until you narrow it down.

commented

Thanks. I think, I understood why it happens. I have both TechReborn and IC2 in the modpack. And I enabled option in TR, which hide double items and remove their recipes. But, I used script which I use before, wo IC2 installed. And it's error because TR remove recipes for items from this script.