Skip to content

Add Minecraft repository as submodule#16

Open
seriouslysean wants to merge 5 commits intomainfrom
claude/add-minecraft-submodule-017HaufV5j33dRVEkJdEDhV7
Open

Add Minecraft repository as submodule#16
seriouslysean wants to merge 5 commits intomainfrom
claude/add-minecraft-submodule-017HaufV5j33dRVEkJdEDhV7

Conversation

@seriouslysean
Copy link
Copy Markdown
Owner

Integrates official Minecraft Bedrock Edition recipes from Mojang's bedrock-samples repository. The parser automatically converts 1,100+ recipes at build time.

Changes:

  • Add bedrock-samples as git submodule at minecraft-data/
  • Create parse-minecraft-recipes.js script to convert recipes
  • Generate items.js, item-details.js, and item-recipes.js from Minecraft data
  • Update app to use generated data files instead of manual data
  • Add parse-recipes npm script that runs before builds
  • Update GitHub Actions workflow to checkout submodules
  • Update README with setup and usage instructions

The parser extracts:

  • 1,136 crafting table recipes (from 1,641 total recipes)
  • 938 unique items with texture paths
  • 741 unique recipe outputs
  • Item groups for variations (planks, logs, etc.)

Resolves #2

@seriouslysean seriouslysean self-assigned this Nov 14, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread scripts/parse-minecraft-recipes.js Outdated
if (Array.isArray(ingredients)) {
for (const item of ingredients) {
if (item.includes('log') || item.includes('stem')) {
if (!knownTags.logs) knownTags.logs = [];
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
if (!knownTags.logs) knownTags.logs = [];

Copilot uses AI. Check for mistakes.
Comment thread scripts/parse-minecraft-recipes.js Outdated

// Collect all planks
if (resultItem.includes('planks')) {
if (!knownTags.planks) knownTags.planks = [];
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
if (!knownTags.planks) knownTags.planks = [];

Copilot uses AI. Check for mistakes.
- 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.
@seriouslysean seriouslysean force-pushed the claude/add-minecraft-submodule-017HaufV5j33dRVEkJdEDhV7 branch from f38d475 to 64d38a2 Compare November 16, 2025 02:24
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
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.

Figure out data format and storage

3 participants