Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR integrates official Minecraft Bedrock Edition recipes from Mojang's bedrock-samples repository as a git submodule. A Node.js parser script automatically converts 1,100+ recipes from Minecraft's JSON format to the app's format at build time, replacing manual data entry with auto-generated files.
Key changes:
- Adds bedrock-samples as a git submodule and a parser script that generates item and recipe data files from Minecraft JSON recipes
- Updates the build process to run recipe parsing before compilation, and modifies GitHub Actions to checkout submodules
- Updates import paths throughout the codebase to use generated data files instead of manual data
Reviewed Changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/views/HomeView.vue | Updates import path to use generated recipe data |
| src/utils/item-utils.js | Updates import paths to use generated item and recipe data |
| scripts/parse-minecraft-recipes.js | New parser script that converts Minecraft recipes to app format |
| scripts/README.md | Documents the parser script functionality and usage |
| package.json | Adds parse-recipes script and integrates it into build process |
| minecraft-data | Adds bedrock-samples as git submodule |
| README.md | Updates documentation with setup instructions and data source information |
| .gitmodules | Configures bedrock-samples submodule |
| .gitignore | Excludes generated data files from version control |
| .github/workflows/deploy.yml | Updates CI to checkout submodules and skip Cypress installation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (Array.isArray(ingredients)) { | ||
| for (const item of ingredients) { | ||
| if (item.includes('log') || item.includes('stem')) { | ||
| if (!knownTags.logs) knownTags.logs = []; |
There was a problem hiding this comment.
The condition if (!knownTags.logs) will always be false because knownTags.logs is initialized as an empty array on line 369. This check is redundant and the initialization inside the condition will never execute.
| if (!knownTags.logs) knownTags.logs = []; |
|
|
||
| // Collect all planks | ||
| if (resultItem.includes('planks')) { | ||
| if (!knownTags.planks) knownTags.planks = []; |
There was a problem hiding this comment.
The condition if (!knownTags.planks) will always be false because knownTags.planks is initialized as an empty array on line 368. This check is redundant and the initialization inside the condition will never execute.
| if (!knownTags.planks) knownTags.planks = []; |
- Add bedrock-samples as git submodule for official Minecraft recipe data - Create parser script that generates TypeScript files from submodule: - items.ts: Item IDs, groups, and types - item-details.ts: Item metadata with names and texture paths - item-recipes.ts: Complete recipe data with patterns and ingredients - Parser features: - Parses all crafting table recipes (1,136 recipes total) - Auto-copies 432+ textures from bedrock-samples to public/textures/ - Resolves item tags (planks, logs) to proper item groups - Prioritizes correct textures (items vs blocks) - Handles melon_block texture fallback correctly - Update data imports to use generated files - Add tool:update npm script and integrate with build process - Add gitignore rules for generated files and textures - Fix TypeScript types for proper Astro compatibility - Add scripts/README.md documenting the parser usage This converts the app from manually-coded recipes to using official Minecraft data, expanding from ~5 recipes to 741 craftable items.
f38d475 to
64d38a2
Compare
Add fallback logic to try reversed naming patterns for textures (e.g., try both 'acacia_planks' and 'planks_acacia'). This fixes texture resolution for many items that were falling back to stick textures. Texture count improved from 432 to 479. Note: Some items (like chest_boat, stairs, slabs) still use fallback textures because they require wood-type prefixes or don't have simple texture file mappings in Minecraft's resource pack.
Texture coverage improved from 479 to 533 textures (51% → 57%). Changes: - Add wood type detection and prefixing for variant items (boats, signs, etc.) - Add derivative block fallbacks (stairs, slabs, walls, fences → base block) - Add door/trapdoor variant handling (_upper, _lower, _top suffixes) - Filter out non-craftable items (chemistry items, debug blocks) - Try reversed naming patterns for all texture lookups Remaining items without textures (456) are mostly: - Derivative blocks that legitimately share base textures - Special items requiring manual name mapping (compass, maps, etc.) - Technical/administrative items
Following KISS principle - instead of overengineering texture matching, simply filter to only show recipes where all items have proper textures. Changes: - Added hasProperTexture() to check if item uses stick fallback - Added isRecipeCraftable() to validate all recipe items - Filter recipes after generating item details - Results: 248 craftable recipes (down from 741 total) - Filtered out 493 recipes with missing textures This ensures the UI mirrors the actual Minecraft crafting experience with complete visual representation for all items.
Added a search input box above the recipe list that allows users to filter recipes in real-time using fuzzy matching. Changes: - Added search input with BEM naming (recipes__search-input) - Implemented fuzzy matching algorithm for flexible searches - Added event listener for real-time filtering - Styled search box with focus states for accessibility - Mobile-responsive design Features: - Direct substring matching for exact searches - Fuzzy matching for character-sequence searches (e.g., "abt" matches "acacia_boat") - Real-time filtering without page reload - Accessible with proper ARIA labels
Integrates official Minecraft Bedrock Edition recipes from Mojang's bedrock-samples repository. The parser automatically converts 1,100+ recipes at build time.
Changes:
The parser extracts:
Resolves #2