Recipe Unlocks Generated Incorrectly
Electrocutor opened this issue · 10 comments
Prerequisites
- I am running the latest alpha version of Structurize for my Minecraft version.
- I checked the MineColonies/Structurize wiki and made sure my issue is not covered there.
- I made sure that this issue is not a duplicate of any existing issue.
Context
- Minecraft Version: 1.16.5
- Structurize Version: 0.13.172
- MineColonies Version (if related bug):
- Related Mods and their Versions:
Expected behavior
Structurize recipes to unlock when acquiring the required materials to craft them when Game Rule 'doLimitedCrafting' is enabled. The recipe unlock advancements are already in the mod, just were not generated correctly.
Actual behavior
Recipes do not unlock.
Steps to reproduce the issue
- Start game with GameRule 'doLimitedCrafting' enabled.
- Get material needed to craft one of the blocks in structurize, notice it does not unlock
- Attempt to craft the block, notice that you cannot
- Enter CreativeMode
- Give yourself that same block, notice the recipe unlocks
- Enter SurvivalMode
- Attempt to craft the block, notice that you can.
Logs
- latest.log:
- crashlog:
Notes
The vanilla .jar contains plenty of example recipe unlock json to use as example. Since 99% of the blocks in structurize are just generic building blocks, a small script can easily generate the recipe unlock files by reading the recipe files.
https://sourceblock.net/beta/guides/fundamentals/data-packs/advancements/triggers/inventory_changed
Viewers
- Add a thumbs-up to the bug report if you are also affected. This helps the bug report become more visible to the team and doesn't clutter the comments.
- Add a comment if you have any insights or background information that isn't already part of the conversation.
ye I do not think we should generate thousands of inventory listeners to support vanilla's recipe unlock system, there are better mods to use instead when gating recipes
ye I do not think we should generate thousands of inventory listeners to support vanilla's recipe unlock system, there are better mods to use instead when gating recipes
As stated, you already have them in the mod, they just weren't formatted right.
Well, we should potentially remove them then, not sure what their overhead is.
I don't agree at all with this.
This is a specific feature Minecraft implements, it even has rules for it, visavi enabling and disabling this.
So if at all, we should provide support for this and this should be fixed.
@Electrocutor What exactly is wrong with our jsons then?
They are already.... There is no way to disable that.
This is baked into the vanilla recipe system.
Unless you rewrite it, there is no way to disable the syncing. It happens if you want to or not.
So I say we should use it.
Well, if we don't create the advancements for it, it won't iterate through them, no?
I would suggest just making a little script that scans the recipe json, and auto-creates a recipe advancement json from it, as that is super simple. If you need me to show a specific example outside from what's included in vanilla data files, let me know and I will.
You don't need a script for that, it's built into the RecipeProvider datagen. The current recipes aren't using datagens, though. That would probably be the thing to change, if people agree that anything needs to be changed at all.
I'm still not sure what existing json you're referring to, though. AFAIK, the existing mcol json doesn't include recipe unlocks at all. The existing advancements are for actual achievements visible in the MC UI, not for recipe unlocks.
Well, we should potentially remove them then, not sure what their overhead is.
I don't agree at all with this.
This is a specific feature Minecraft implements, it even has rules for it, visavi enabling and disabling this.
So if at all, we should provide support for this and this should be fixed.@Electrocutor What exactly is wrong with our jsons then?
You can look at the vanilla json for examples. Your json only unlocks after you get the item. The recipe json should be setup to either give the recipe by OR when you get any of the components that makes it up, or by AND where you need to have all the components that make it up (I've seen it done both ways). Considering how intrinsic and nonsensical the build scepter is in recipes, I would suggest not having that as part of the unlock though.
I would suggest just making a little script that scans the recipe json, and auto-creates a recipe advancement json from it, as that is super simple. If you need me to show a specific example outside from what's included in vanilla data files, let me know and I will.
As a side note, on the minecolonies side, you could make it more interesting and story-driven, so the recipes unlock when you do certain things in the colony instead of just making them resource-based if you wanted to. Currently, both Structurize and Minecolonies are unusable on a doLimitedCrafting survival game with cheats off.