Artisan Worktables 1.12

Artisan Worktables 1.12

3M Downloads

NPE when using CraftTweaker recipe function

CheshireSwift opened this issue ยท 3 comments

commented

Issue Description

Null pointer exception when crafting a recipe that uses a recipe function in the CT RecipeBuilder.

What Happens

  • Create a CT script that adds a recipe, calling the setRecipeFunction method on the RecipeBuilder.
  • Make that recipe in-game.
  • NPE occurs.

Function runs fine when displaying recipe output (in the case of the attached script, able to upgrade an iron pick to a diamond pick with the same durability), the NPE only occurs when actually taking the output. The correct output is received, it's just the NPE error causing a popup that's the issue.

Guessing that RecipeMatcher.findMatches is hitting one of the cases where it returns null, so getting an NPE on CTArtisanRecipe:305 when checking the length.

What You Expect to Happen

No NPE when taking the item.

Script

https://gist.github.com/CheshireSwift/32790ae922ab66fd85d9d4c0694d3b91

Error occurs both as-written (i.e. no-op) and with the commented out function body instead.

Crash Log

https://pastebin.com/s10nMsBx

Affected Versions

  • Minecraft: 1.12.2
  • Forge: 14.23.5.2781
  • CraftTweaker: 1.12-4.1.13
  • Artisan Worktables: 1.12.2-1.21.4
  • Athenaeum: 1.12.2-1.17.2

(Was on an older version of Worktables + Athenaeum when I first got the issue, but it persists on the latest versions too.)

commented

Thank you for the report! I will investigate this.

commented

I think it's fixed, I'll get a build out soon.

2019-07-07_16-16-32

commented

Fixed in 1.12.2-1.21.5