Structured Crafting

Structured Crafting

2M Downloads

Incompatibility with Gamestages

Tschipp opened this issue ยท 4 comments

commented

Issue type:

  • ๐Ÿ› Bug

Short description:

Staged recipes don't work with the Structured Crafter.

Steps to reproduce the problem:

  1. Stage any recipe using gamestages, recipestages and crafttweaker
  2. Try to craft that recipe

Expected behaviour:

Since recipe stages prevents only players from crafting items, it shouldn't prevent this.

Versions:

  • This mod: 0.2.1
  • Minecraft: 1.12.2
  • Forge: 14.23.5.2838

Further Information:

I assume you're using some kind of fake player to craft the things, I haven't really looked into your code. That fake player will not have the required game stages and thus not be able to craft, that's my theory at least.
I think the most logical way to handle staged recipe is just to craft it anyways, regardless of what stages the player has. I think this makes sense because if the player is able to access the required materials for the recipe, then they probably can also craft the recipe. This would make it the modpack maker's responsibility to make sure the player doesn't have items they're not supposed to have.

I also have some screenshots:
image

image

commented

Hm, I guess you are right about the compat, but it's a shame because gamestages is widespread and makes this mod basically unusable if many recipes are staged.
I poked around in the RecipeStages code and found this:
https://github.com/jaredlll08/RecipeStages/blob/master/src/main/java/com/blamejared/recipestages/recipes/RecipeStage.java#L82
Since the container of your crafting matrix is a dummy container that no player has open (obviously), this fails.

But I think I may have found a workaround:
https://github.com/jaredlll08/RecipeStages/blob/master/src/main/java/com/blamejared/recipestages/recipes/RecipeStage.java#L97
There's a thing called crafter stages that can be applied, maybe I can try to add the class name to that list and see what happens.

GitHub
Contribute to jaredlll08/RecipeStages development by creating an account on GitHub.
GitHub
Contribute to jaredlll08/RecipeStages development by creating an account on GitHub.
commented

On the one hand, this mod has no dedicated support for gamestages, so if something breaks, this is a problem with gamestages.

On the other hand, I would even say this is intended behaviour, since a structured crafter would otherwise undo the need for gamestages.

The cleanest way would be to create an addon for structured crafter that has dedicated gamestages support, which you can there configure any way you want. But unfortunately, there's not much I can do in this mod here.

commented

But I think I may have found a workaround:

If you think some non-disruptive change to this mod could be made to make this work, feel free to send a PR.

commented

Gamestages actually has this a mechanic that solves this issue pretty neatly, I just didn't know about it. So I don't think anything is needed here after all.