Files
minecraft-data-generator/.github/workflows/build.yml
T
rom1504botGitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>extremeheatCopilotextremeheat
e359900c40 🎈 Add version 1.21.8 (#53)
* Add version 1.21.8

* send Change branch from 'main' to 'master'

* 🎈 Fix empty ingredients in 1.21.8 recipe generation by using display API correctly (#54)

* Initial plan

* Fix empty ingredients in 1.21.8 by using sl.getIngredients() instead of sl.display()

Co-authored-by: extremeheat <13713600+extremeheat@users.noreply.github.com>

* Update README.md

* Fix 1.21.8 shapeless recipe ingredients by using display API correctly

- Changed from trying to access sl.ingredients field (package-private) to using sl.display() properly
- Extract ingredients from ShapelessCraftingRecipeDisplay using SlotDisplay.resolveForFirstStack()
- Use SlotDisplayContext.fromLevel() to provide proper context for resolving items
- Successfully generates 295 shapeless recipes with proper ingredient arrays instead of empty arrays
- Tested with full data generation run - recipes.json now contains populated ingredients

Co-authored-by: extremeheat <13713600+extremeheat@users.noreply.github.com>

* Update build.yml

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: extremeheat <13713600+extremeheat@users.noreply.github.com>
Co-authored-by: extremeheat <extreme@protonmail.ch>

* Rename AGENTS.md to copilot-instructions.md

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: extremeheat <extreme@protonmail.ch>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: extremeheat <13713600+extremeheat@users.noreply.github.com>
2025-09-07 08:33:48 +02:00

118 lines
3.1 KiB
YAML

name: Java CI with Gradle
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
permissions:
pull-requests: write
env:
MARKER: '🎈'
jobs:
define-versions:
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.versions.outputs.versions }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Define Versions
id: versions
run: |
versions="["
for item in $(ls mc); do
versions+="\"$item\", "
done
versions="${versions%,*}]"
echo "versions=$versions" >> "$GITHUB_OUTPUT"
- name: Ensure that versions.json includes all versions
run: node -e 'const fs = require("fs"); const versions = JSON.parse(fs.readFileSync("versions.json", "utf8")); const expectedVersions = fs.readdirSync("mc"); if (expectedVersions.length !== versions.length || !expectedVersions.every(v => versions.includes(v))) { throw new Error("versions.json does not match the expected versions in mc/ folder"); }'
build:
needs: define-versions
strategy:
fail-fast: false
matrix:
version: ${{ fromJSON(needs.define-versions.outputs.versions) }}
name: Build ${{ matrix.version }}
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
add-job-summary-as-pr-comment: on-failure
- name: Generate ${{ matrix.version }}
run: ./gradlew :mc:${{ matrix.version }}:runServer --stacktrace
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: data-${{ matrix.version }}
path: mc/${{ matrix.version }}/run/server/minecraft-data
if-no-files-found: error
repackage:
needs: build
name: Repackage versions
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- run: npm install
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Upload artifact
id: uploadMerged
uses: actions/upload-artifact@v4
with:
name: merged-data
path: artifacts/*
if-no-files-found: error
- run: cat "$GITHUB_EVENT_PATH"
- name: Sending artifacts to minecraft-data
# Check if PR starts with marker
if: startsWith(github.event.pull_request.title, env.MARKER)
env:
ARTIFACT_URL: ${{ steps.uploadMerged.outputs.artifact-url }}
GITHUB_TOKEN: ${{ secrets.PAT_PASSWORD }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: node .github/commands/send.js