[Suggestion] CT/Gamestages recipe removal options
thephoenixlodge opened this issue ยท 10 comments
At present there is only script handlers to add recipes but not remove them, which from the point of view of there being no recipes in the worktables by default, makes sense. However with the fact the gamestages are supported, there are cases where the pack dev might want to add a recipe at one stage, and then remove it in a different stage, either in lieu of a better recipe for the same item that uses different components, or to use the same recipe layout to produce something different.
For example, say that from the start of the pack the player can craft an iron chestplate with the regular recipe, though moved to the blacksmith's table, but are then later able to unlock a stage which uses the same recipe layout, but instead of just crafting a normal iron chestplate, it crafts an iron chestplate which gives +5 Health when worn. For this situation it would be necessary to be able to remove the original iron chestplate recipe, which is currently not possible.
As an aside, do staged recipes not show up in JEI at all? Or does that require a pack reload after unlocking the stage?
As an aside, do staged recipes not show up in JEI at all? Or does that require a pack reload after unlocking the stage?
Staged recipes are only shown to the player in JEI if they have the required stage. A pack reload is not required. The mod responds to GameStage events fired by the server and hides / unhides JEI recipes as needed.
Hmm, I'll have to double check then, but I could've sworn I was still seeing no recipe in JEI after unlocking the stage (and testing that the recipe was working with the actual table)
Yes, please check. I've tested this behavior again and it works fine for me. If it doesn't work for you, please make a new issue. Thanks.
Edit: If you do have trouble with it, please make sure to indicate relevant versions in the new issue - Forge, Artisan Worktables, GameStages.
I've restructured the back-end recipe handling in anticipation of #18 and I've included a more flexible game stage matching system. The existing recipe syntax will still be available and won't change. The advanced syntax will expose the underlying recipe builder to ZenScript and the new, advanced syntax will look something like this:
Worktable.RecipeBuilder
.forTable("carpenter")
.setIngredients([
[<minecraft:planks>],
[<minecraft:planks>],
[<minecraft:planks>]])
.setMirrored()
.setTool(<ore:carpenters_hammer>, 3)
.addOutput(<minecraft:string>, 25)
.addOutput(<minecraft:flint>, 100)
.setExtraOutputOne(<minecraft:stone> * 5, 0.12)
.setExtraOutputTwo(<minecraft:stone> * 5, 0.12)
.setExtraOutputThree(<minecraft:stone> * 5, 0.12)
.requireGamestages("ANY", ["one"])
.excludeGamestages(["two"])
.create();
Using this syntax you will be able to define an unlimited number of weighted outputs for a recipe as well as more flexible gamestage matching rules. In the example above, the player will have access to the recipe if they have any of the required gamestages (one
) and none of the excluded gamestages (two
). As soon as the player acquires gamestage two
, this recipe will disappear and no longer be displayed in JEI and no longer be craftable. I'm confident that these configuration options can be leveraged to tackle the case you initially presented.
Ok cool, this looks like it will do the job nicely. Out of curiosity, what else can replace the "ANY" in the .requiredGamestages() line?
Moving the conversation back to the main topic, the case you presented is possible with the current systems. Make two recipes, one for the normal armor with gamestage blacksmith_level_1
and one for the better armor with gamestage blacksmith_level_2
. Then, when the player advances to blacksmith_level_2
, remove blacksmith_level_1
. I realize that it isn't ideal if you want to keep the first gamestage when advancing the player to the second gamestage, but it does work.
Right now the gamestage matcher is set up for ANY
and ALL
.
ANY
: The player must have unlocked at least one of the listed gamestages.
ALL
: The player must have unlocked all of the listed gamestages.
The matcher will fail when the player has unlocked any of the listed excluded stages.
Am I correct in the assumption that at least some of your weighted recipe outputs will have NBT data that differentiates them from one another?