Artisan Worktables 1.12

Artisan Worktables 1.12

3M Downloads

GameStages Staged Recipes Don't Show Up In JEI

legendblade opened this issue ยท 2 comments

commented

Issue Description

Due to the mentioned behavior in Darkhax-Minecraft/Game-Stages#21 - attempting to stage a recipe through GameStages causes the recipe to not show up in JEI even when the player has the appropriate stage, because the way that Artisan Worktables accesses the IStageData is invalid on the client side.

What Happens

Adding any of the GameStages requirements through mods.artisanworktables.integration.requirement.GameStages causes the recipe to no longer show up in JEI even when the player has the appropriate Game Stage.

  • Create a recipe in two separate tables.
  • Use RecipeBuilder's addRequirement to add a GameStages.anyOf(["stageName"]) requirement to one of the two recipes.
  • Observe the recipe with the GameStage requirement is missing from JEI, and player cannot craft item.
  • Use /gamestages add @p stageName to give yourself the stage
  • Observe the recipe with the GameStage requirement is still missing from JEI, and player intermittently cannot craft the item**.

** When initially discovering this bug, I was able to still craft the item despite it not showing up in JEI. In testing in a separate instance with the same versions of mods, with the sample file, I cannot get the GameStage'd recipe to show up, despite it being valid. This does not directly impact the bug itself, but I thought it was worth mentioning regardless.

What You Expect to Happen

Giving yourself a required stage for a recipe will show the recipe in JEI and allow you to craft the item.

Script

https://gist.github.com/legendblade/ebd852c702dc06781ac0642a47496d4f

Crash Log

N/A

Affected Versions

  • Minecraft: 1.12.2
  • Forge: 14.23.4.2703
  • CraftTweaker: 4.1.8
  • Artisan Worktables: 1.19.0-SNAPSHOT.6
  • Athenaeum: 1.14.0
  • GameStages: 2.0.91
commented

Thanks for the report!

There were three separate problems that aligned to create this undesired behavior:

  1. incorrect usage of client side IStageData, as you indicated
  2. all GS stages are lowercase; AW's GS requirement context not enforcing lowercase
  3. usage of JEI's deprecated recipe hide and unhide methods

I wasn't able to reproduce exactly the behavior that you describe, but I was able to use your script and other info to get enough undesirable results that I am confident this issue has been resolved. I will push a new build to Curse soon, let me know how it works for you. :)

commented

Ah. That's probably why the two scripts were giving me different results between my actual instance and my test instance - because the stage name in the actual instance was all lowercase while the test instance I was using "stageName" (I knew I should have stuck with something like "foo"! XD)

I've confirmed that in 1.19.0-SNAPSHOT.7 this has been resolved in both test and full instances so both "stageName" and "stage3" are working again.

Sorry for missing the other two root causes, I should have been a bit more thorough before reporting the issue.

Anyway, I appreciate you taking care of things so quickly. Thanks again!