Skip to content

Generate recipes for 1.10.2, 1.11.2 and 1.12.2 - #81

Merged
rom1504 merged 2 commits into
mainfrom
recipes-pre-1.13
Sep 19, 2026
Merged

rom1504 merged 2 commits into
mainfrom
recipes-pre-1.13

Conversation

@u9g

@u9g u9g commented Sep 8, 2026

Copy link
Copy Markdown
Member

Implements RecipeDataGenerator for the 1.10.2, 1.11.2 and 1.12.2 modules (previously a disabled stub). 1.10.2 and 1.11.2 read RecipeDispatcher.getInstance().getAllRecipes() through accessor mixins for the private recipe fields; 1.12.2 reads RecipeDispatcher.REGISTRY and expands Ingredient alternatives.

Output follows the minecraft-data recipes schema for metadata versions:

  • An ingredient is a bare item id when it accepts any metadata: the vanilla wildcard damage 32767 (bare Blocks.PLANKS in 1.10/1.11 code recipes), an item that only exists with one metadata value, or a 1.12 alternatives list that covers every variant of one item (planks 0-5 in crafting_table.json). This is exact per slot: vanilla accepts mixed plank types in one grid.
  • Otherwise an ingredient is {id, metadata}. Alternatives that do not collapse are expanded into separate recipes.
  • Results are {id, metadata, count}.
  • Only ShapedRecipeType and ShapelessRecipeType themselves are emitted. Subclasses such as map extending compute their output at craft time, as do the special recipe types (dyeing, repair, banners, fireworks, book copying).

Legacy yarn 541 maps 1.12.2 Item.getHasSubtypes to a wrong name (the method named hasSubTypes is a constant false), so variants are derived from the item's own creative-tab stacks instead.

For 1.12.2 the output equals a direct conversion of the 432 recipe JSON files in the client jar, recipe for recipe.

@rom1504 rom1504 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Astra agent review — AI-generated, not manually written by the maintainer.

Reviewed at the maintainer's request. I inspected all changed generator implementations and the full generated recipe files, compared cake against the base data, loaded all three outputs through prismarine-recipe, checked recipe shapes/counts and mixed-plank matching, and traced the current Mineflayer crafting consumer. The inline finding concerns lost crafting remainders. I did not run the Java generator or a live crafting server.

}
JsonObject json = new JsonObject();
json.add("inShape", inShape);
json.add("result", resultFor(recipe.getOutput()));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Astra agent review — AI-generated, not manually written by the maintainer.

Could the shaped generators also emit crafting remainders as outShape? Cake is a concrete case: its three milk buckets (335) leave three empty buckets (325), as documented in minecraft-data's recipe schema. These generators only emit inShape/result, and all three files in minecraft-data#1283 consequently lose the previously present bucket row. In Mineflayer craft.js, updateOutShape() clears the local crafting grid and returns when this field is absent, skipping the putAway calls that collect those buckets. Please preserve the remainder shape for all three versions and add a cake regression checking the three returned buckets.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in b49eacf. The 1.10.2, 1.11.2 and 1.12.2 shaped generators now emit outShape. It holds Item.getRecipeRemainder() for each cell and is included only when some slot has a remainder. In 1.12.2 each ingredient alternative carries its item so the remainder follows the cartesian expansion. The cake regression check lives in minecraft-data (PrismarineJS/minecraft-data#1283, cake returns its buckets in audit_recipes.js).

Cake leaves three buckets behind in the grid; without outShape, mineflayer
clears the grid instead of collecting them.
@u9g

u9g commented Sep 19, 2026

Copy link
Copy Markdown
Member Author

Thanks for the review. Its one finding, lost crafting remainders, is addressed in b49eacf: shaped recipes in 1.10.2, 1.11.2 and 1.12.2 now emit outShape from each ingredient's Item.getRecipeRemainder(). The regenerated data and a cake regression check are in PrismarineJS/minecraft-data#1283.

@rom1504 rom1504 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Astra agent review — AI-generated, not manually written by the maintainer.

Looks ready to merge from this review. The three shaped generators now preserve per-cell recipe remainders, including the item chosen during 1.12 alternative expansion. I downloaded this head's successful CI artifacts for 1.10.2/1.11.2/1.12.2 and compared their entire recipe outputs to minecraft-data #1283: all match, including cake's three empty buckets. All 1,206 records also load through prismarine-recipe with mixed-plank wildcards preserved. Current generator CI is green. Java generation was executed by CI; my independent checks cover its artifacts and downstream models, not a locally rerun Java server.

Skills used: prismarine-item-inventory-review traced cake remainders into prismarine-recipe/Mineflayer; prismarine-protocol-data-review checked generator output against the published-data candidate; prismarine-review checked current revisions, CI and existing feedback.

@rom1504
rom1504 merged commit 3383ef8 into main Sep 19, 2026
62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants