Artisan Worktables 1.12

Artisan Worktables 1.12

3M Downloads

Cannot remove ingredients from copied shapeless recipes

PrincessRTFM opened this issue ยท 1 comments

commented

Issue Description

When copying a shapeless recipe and removing an ingredient, I get an error in the crafttweaker log about a null ingredient in a shapeless recipe.

What Happens

I attempted to copy a set of recipes by output, using an ore dictionary entry to specify the output, into an engineer's table, with one item removed from all recipes (if present) and added requirements of a tool and secondary ingredients. The script errored, telling me that shapeless recipes may not have null ingredients, and that a null ingredient was found.

To reproduce, use the recipe copier to clone any shapeless recipe into an artisan worktable, and transform the copy by replacing any input ingredient with null, via .replaceInput().

What You Expect to Happen

I expected the recipe to be copied with the specified ingredient removed from the input matrix.

Script

The script is over 1,300 lines long, but the erroring line is this one:

RecipeBuilder.get("engineer")
	.setCopy(
		Copy.byOutput([<ore:button>]).replaceInput(<morebeautifulbuttons:button_press>, null)
	)
	.addTool(<ore:artisansHandsaw>, 3)
	.setSecondaryIngredients([<ore:dustRedstone>])
	.setConsumeSecondaryIngredients(true)
	.setExtraOutputOne(<minecraft:redstone>, 0.8)
	.setMirrored()
	.create();

Crash Log

Game did not crash. Please let me know if I should force one for diagnostics.

Affected Versions

  • Minecraft: 1.12.2
  • Forge: 14.23.5.2816
  • CraftTweaker: 4.1.17
  • Artisan Worktables: 1.21.1
  • Athenaeum: 1.16.0-1-g05e9
commented
[POSTINITIALIZATION][CLIENT][ERROR] Unable to copy and register recipe
com.codetaylor.mc.artisanworktables.api.internal.recipe.RecipeBuilderException: Shapeless ingredient array can't contain empty elements, found emtpy element at index: 0
	at com.codetaylor.mc.artisanworktables.modules.worktables.recipe.RecipeBuilderInternal.setInvalid(RecipeBuilderInternal.java:187)
	at com.codetaylor.mc.artisanworktables.modules.worktables.recipe.RecipeBuilderInternal.isNotEmpty(RecipeBuilderInternal.java:138)
	at com.codetaylor.mc.artisanworktables.modules.worktables.recipe.RecipeBuilderInternal.setIngredients(RecipeBuilderInternal.java:256)
	at com.codetaylor.mc.artisanworktables.modules.worktables.recipe.copy.RecipeBuilderCopyHelper.copyShapelessRecipeInput(RecipeBuilderCopyHelper.java:91)
	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_26_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:125)