From 7da4e67837eb04c5ad577dcf463dfab31f8ea8f1 Mon Sep 17 00:00:00 2001 From: JohnBraham Date: Mon, 23 Nov 2026 17:19:02 +0000 Subject: [PATCH] Bring Base Gems to Minecraft 1.14.4 --- .github/workflows/ci.yml | 14 +- .github/workflows/deploy-release.yml | 43 ++-- .github/workflows/release-on-tag.yml | 6 +- .gitignore | 1 + CHANGELOG.txt | 17 ++ LICENSE-ART.txt | 38 +-- README.md | 50 ++-- build.gradle | 11 +- docs/BUILDING.md | 43 +++- docs/MANUAL_TESTING.md | 48 ++++ docs/MIGRATION.md | 43 ++-- docs/PORTING_114.md | 50 ++++ docs/RELEASING.md | 14 +- gradle.properties | 17 +- gradle/compatibility-114.gradle | 121 +++++++++ gradle/dependencies.json | 17 +- gradle/eclipse.gradle | 3 + gradle/generate-resources.py | 45 +++- gradle/model-templates.json | 24 +- ...{release-113.gradle => release-114.gradle} | 47 +++- gradle/release/artifacts.gradle | 12 +- gradle/resources.gradle | 8 + gradle/verification-114.gradle | 90 +++++++ .../basegems/testmod/BaseGemsClientProbe.java | 166 +++++++++++++ .../resources/META-INF/mods.toml | 7 + .../resources/pack.mcmeta | 1 + .../mc/basegems/testmod/BaseGemsProbe.java | 219 +++++++++++++++++ .../resources/META-INF/mods.toml | 7 + .../data/forge/tags/items/gems/ruby.json | 1 + src/integrationTest/resources/pack.mcmeta | 1 + .../zone/moddev/mc/basegems/BaseGems.java | 3 +- .../zone/moddev/mc/basegems/GemEvents.java | 28 +-- .../client/ClientMoltenGemRenderer.java | 54 ---- .../mc/basegems/client/ClientSetup.java | 5 +- .../mc/basegems/client/GemConfigScreen.java | 42 ++-- .../client/MaterialProjectileRenderer.java | 8 +- .../basegems/client/ModsListConfigButton.java | 51 ---- .../moddev/mc/basegems/config/GemConfig.java | 1 + .../content/CompatibilityDoubleSlabBlock.java | 18 +- .../mc/basegems/content/CrackhammerItem.java | 50 ++-- .../mc/basegems/content/FluidContent.java | 8 +- .../mc/basegems/content/GemAmmoItem.java | 10 +- .../moddev/mc/basegems/content/GemBlocks.java | 62 ++--- .../mc/basegems/content/GemBucketItem.java | 6 +- .../mc/basegems/content/GemOreBlock.java | 17 +- .../mc/basegems/content/MaterialItems.java | 80 +++--- .../mc/basegems/content/ModContent.java | 30 ++- .../mc/basegems/content/MoltenFluid.java | 42 ++-- .../mc/basegems/content/PlateBlock.java | 20 +- .../basegems/entity/MaterialProjectile.java | 18 +- .../mc/basegems/entity/ModEntities.java | 5 +- .../basegems/migration/LegacyDoorStates.java | 62 ++--- .../migration/LegacyWorldDataHook.java | 231 +++++++++--------- .../network/GameplaySettingsNetwork.java | 93 +++++++ .../recipe/ContentCraftingRecipe.java | 48 ++-- .../mc/basegems/recipe/CrushingRecipe.java | 49 ++-- .../mc/basegems/recipe/GemBlastingRecipe.java | 60 +++++ .../mc/basegems/recipe/GemSmeltingRecipe.java | 18 +- .../mc/basegems/recipe/PlateRepairRecipe.java | 30 ++- .../moddev/mc/basegems/trade/GemTrades.java | 71 +++--- src/main/resources/META-INF/mods.toml | 13 +- .../resources/assets/basegems/lang/de_DE.lang | 1 + .../resources/assets/basegems/lang/en_AU.lang | 1 + .../resources/assets/basegems/lang/en_CA.lang | 1 + .../resources/assets/basegems/lang/en_EN.lang | 1 + .../resources/assets/basegems/lang/en_GB.lang | 1 + .../resources/assets/basegems/lang/en_PT.lang | 1 + .../resources/assets/basegems/lang/en_us.lang | 1 + .../resources/assets/basegems/lang/es_ES.lang | 1 + .../resources/assets/basegems/lang/es_MX.lang | 1 + .../resources/assets/basegems/lang/fr_CA.lang | 1 + .../resources/assets/basegems/lang/fr_FR.lang | 1 + .../resources/assets/basegems/lang/it_IT.lang | 1 + .../resources/assets/basegems/lang/ja_JP.lang | 1 + .../resources/assets/basegems/lang/nl_NL.lang | 1 + .../resources/assets/basegems/lang/pt_BR.lang | 1 + .../resources/assets/basegems/lang/ru_RU.lang | 1 + .../resources/assets/basegems/lang/zh_CN.lang | 1 + .../resources/assets/basegems/lang/zh_TW.lang | 1 + .../{blocks => block}/molten_metal_flow.png | Bin .../molten_metal_flow.png.mcmeta | 0 .../{blocks => block}/molten_metal_still.png | Bin .../molten_metal_still.png.mcmeta | 0 .../basegems/textures/items/bucket_fluid.png | Bin 0 -> 163 bytes .../textures/items/bucket_overlay.png | Bin 0 -> 214 bytes .../coremods/basegems_legacy_worlds.js | 197 +++------------ tools/test_port_114.js | 104 ++++++++ 87 files changed, 1832 insertions(+), 884 deletions(-) create mode 100644 docs/MANUAL_TESTING.md create mode 100644 docs/PORTING_114.md create mode 100644 gradle/compatibility-114.gradle rename gradle/{release-113.gradle => release-114.gradle} (80%) create mode 100644 gradle/verification-114.gradle create mode 100644 src/clientIntegrationTest/java/zone/moddev/mc/basegems/testmod/BaseGemsClientProbe.java create mode 100644 src/clientIntegrationTest/resources/META-INF/mods.toml create mode 100644 src/clientIntegrationTest/resources/pack.mcmeta create mode 100644 src/integrationTest/java/zone/moddev/mc/basegems/testmod/BaseGemsProbe.java create mode 100644 src/integrationTest/resources/META-INF/mods.toml create mode 100644 src/integrationTest/resources/data/forge/tags/items/gems/ruby.json create mode 100644 src/integrationTest/resources/pack.mcmeta delete mode 100644 src/main/java/zone/moddev/mc/basegems/client/ClientMoltenGemRenderer.java delete mode 100644 src/main/java/zone/moddev/mc/basegems/client/ModsListConfigButton.java create mode 100644 src/main/java/zone/moddev/mc/basegems/network/GameplaySettingsNetwork.java create mode 100644 src/main/java/zone/moddev/mc/basegems/recipe/GemBlastingRecipe.java rename src/main/resources/assets/basegems/textures/{blocks => block}/molten_metal_flow.png (100%) rename src/main/resources/assets/basegems/textures/{blocks => block}/molten_metal_flow.png.mcmeta (100%) rename src/main/resources/assets/basegems/textures/{blocks => block}/molten_metal_still.png (100%) rename src/main/resources/assets/basegems/textures/{blocks => block}/molten_metal_still.png.mcmeta (100%) create mode 100644 src/main/resources/assets/basegems/textures/items/bucket_fluid.png create mode 100644 src/main/resources/assets/basegems/textures/items/bucket_overlay.png create mode 100644 tools/test_port_114.js diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db34f62..6e94332 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,16 +1,16 @@ -name: Base Gems 1.13.2 CI +name: Base Gems 1.14.4 CI on: push: - branches: [master-1.13.2, 'feature/**'] + branches: [master-1.14.4, 'feature/**'] pull_request: - branches: [master-1.13.2] + branches: [master-1.14.4] permissions: contents: read concurrency: - group: basegems-113-${{ github.workflow }}-${{ github.ref }} + group: basegems-114-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -44,7 +44,7 @@ jobs: run: python3 gradle/stage-legacy-dependencies.py .gradle/legacy-dependencies - name: Build, audit and generate Eclipse launches run: | - bash ./gradlew clean check build javadoc verify113ReleaseArtifacts write113ReleaseChecksums prepareEclipse \ + bash ./gradlew clean check build javadoc verify114ReleaseArtifacts write114ReleaseChecksums prepareEclipse \ -PreleaseBuild=true -PlegacyDependencyVerificationRepository="$PWD/.gradle/legacy-dependencies" \ --no-daemon --stacktrace --max-workers=2 \ "-Dorg.gradle.java.installations.paths=$JAVA_HOME,$JAVA_HOME_8_X64,$JAVA_HOME_25_X64" \ @@ -57,7 +57,7 @@ jobs: - name: Upload audited release candidate uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 with: - name: BaseGems-1.13.2-${{ github.sha }} + name: BaseGems-1.14.4-${{ github.sha }} if-no-files-found: error retention-days: 30 path: build/release-bundle/ @@ -65,7 +65,7 @@ jobs: if: failure() uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 with: - name: BaseGems-1.13.2-diagnostics-${{ github.sha }} + name: BaseGems-1.14.4-diagnostics-${{ github.sha }} if-no-files-found: ignore retention-days: 14 path: | diff --git a/.github/workflows/deploy-release.yml b/.github/workflows/deploy-release.yml index 54ff227..d9762b4 100644 --- a/.github/workflows/deploy-release.yml +++ b/.github/workflows/deploy-release.yml @@ -1,15 +1,15 @@ -name: Release Base Gems 1.13.2 +name: Release Base Gems 1.14.4 run-name: Base Gems ${{ inputs.release_version }} (${{ inputs.confirm_live_publication && 'publish' || 'verify' }}) on: workflow_dispatch: inputs: release_version: - description: Four-part version for Minecraft 1.13.2 + description: Four-part version for Minecraft 1.14.4 required: true type: string release_commit: - description: Full SHA of the checked MMD master-1.13.2 commit + description: Full SHA of the checked MMD master-1.14.4 commit required: true type: string tested_jar_sha256: @@ -33,13 +33,13 @@ permissions: contents: read concurrency: - group: basegems-release-113 + group: basegems-release-114 cancel-in-progress: false jobs: qualify: name: Verify merged CI candidate - if: github.repository == 'MinecraftModDevelopmentMods/BaseGems' && github.ref == 'refs/heads/master-1.13.2' + if: github.repository == 'MinecraftModDevelopmentMods/BaseGems' && github.ref == 'refs/heads/master-1.14.4' runs-on: ubuntu-latest timeout-minutes: 10 permissions: @@ -61,21 +61,21 @@ jobs: TESTED_SHA: ${{ inputs.tested_jar_sha256 }} run: | set -euo pipefail - [[ "$RELEASE_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+\.113021$ ]] + [[ "$RELEASE_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+\.114041$ ]] [[ "$RELEASE_SHA" =~ ^[[:xdigit:]]{40}$ ]] [[ "$TESTED_SHA" =~ ^[[:xdigit:]]{64}$ ]] test "$(git rev-parse HEAD)" = "$RELEASE_SHA" - test "$(gh api "repos/$GITHUB_REPOSITORY/branches/master-1.13.2" --jq .commit.sha)" = "$RELEASE_SHA" + test "$(gh api "repos/$GITHUB_REPOSITORY/branches/master-1.14.4" --jq .commit.sha)" = "$RELEASE_SHA" grep -Fxq "mod_version=$RELEASE_VERSION" gradle.properties - grep -Fxq 'minecraft_version=1.13.2' gradle.properties + grep -Fxq 'minecraft_version=1.14.4' gradle.properties ci_run="$(gh api --method GET "repos/$GITHUB_REPOSITORY/actions/workflows/ci.yml/runs" \ - -f branch=master-1.13.2 -f head_sha="$RELEASE_SHA" -f event=push -f status=success \ + -f branch=master-1.14.4 -f head_sha="$RELEASE_SHA" -f event=push -f status=success \ --jq '.workflow_runs[0].id // empty')" test -n "$ci_run" echo "ci_run=$ci_run" >> "$GITHUB_OUTPUT" - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 with: - name: BaseGems-1.13.2-${{ inputs.release_commit }} + name: BaseGems-1.14.4-${{ inputs.release_commit }} run-id: ${{ steps.candidate.outputs.ci_run }} github-token: ${{ github.token }} path: ${{ runner.temp }}/release-input @@ -152,7 +152,7 @@ jobs: - uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6 - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 with: - name: BaseGems-1.13.2-${{ inputs.release_commit }} + name: BaseGems-1.14.4-${{ inputs.release_commit }} run-id: ${{ needs.qualify.outputs.ci_run }} github-token: ${{ github.token }} path: ${{ runner.temp }}/release-input @@ -179,7 +179,7 @@ jobs: steps: - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 with: - name: BaseGems-1.13.2-${{ inputs.release_commit }} + name: BaseGems-1.14.4-${{ inputs.release_commit }} run-id: ${{ needs.qualify.outputs.ci_run }} github-token: ${{ github.token }} path: ${{ runner.temp }}/release-input @@ -187,16 +187,17 @@ jobs: working-directory: ${{ runner.temp }}/release-input run: sha256sum --check --strict SHA256SUMS - name: Publish Base Gems + id: curseforge uses: Kira-NT/mc-publish@52307b03863581dec6b652b83e597aec02ebb075 # v3.3.1 with: curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} curseforge-id: '1793939' - name: Base Gems ${{ inputs.release_version }} for Minecraft 1.13.2 (Forge) + name: Base Gems ${{ inputs.release_version }} for Minecraft 1.14.4 (Forge) version: ${{ inputs.release_version }} version-type: ${{ inputs.curseforge_release_level }} changelog-file: ${{ runner.temp }}/release-input/CHANGELOG.txt loaders: forge - game-versions: '1.13.2' + game-versions: '1.14.4' game-version-filter: none environment: client | server java: Java 8 @@ -210,6 +211,16 @@ jobs: ${{ runner.temp }}/release-input/BaseGems-${{ inputs.release_version }}-sources.jar ${{ runner.temp }}/release-input/BaseGems-${{ inputs.release_version }}-javadoc.jar + - name: Record the accepted CurseForge files + env: + CURSEFORGE_URL: ${{ steps.curseforge.outputs.curseforge-url }} + CURSEFORGE_FILES: ${{ steps.curseforge.outputs.curseforge-files }} + run: | + python3 - <<'PY' + import json, os + print(json.dumps({'url': os.environ['CURSEFORGE_URL'], 'files': os.environ['CURSEFORGE_FILES']})) + PY + publish_github: name: Publish GitHub Release needs: [qualify, publish_curseforge] @@ -222,7 +233,7 @@ jobs: steps: - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 with: - name: BaseGems-1.13.2-${{ inputs.release_commit }} + name: BaseGems-1.14.4-${{ inputs.release_commit }} run-id: ${{ needs.qualify.outputs.ci_run }} github-token: ${{ github.token }} path: ${{ runner.temp }}/release-input @@ -235,5 +246,5 @@ jobs: set -euo pipefail sha256sum --check --strict SHA256SUMS gh release create "$RELEASE_VERSION" --repo "$GITHUB_REPOSITORY" --verify-tag \ - --title "Base Gems $RELEASE_VERSION for Minecraft 1.13.2 (Forge)" \ + --title "Base Gems $RELEASE_VERSION for Minecraft 1.14.4 (Forge)" \ --notes-file CHANGELOG.txt "BaseGems-$RELEASE_VERSION"{,-sources,-javadoc}.jar SHA256SUMS diff --git a/.github/workflows/release-on-tag.yml b/.github/workflows/release-on-tag.yml index caa48fd..58b0cbf 100644 --- a/.github/workflows/release-on-tag.yml +++ b/.github/workflows/release-on-tag.yml @@ -1,7 +1,7 @@ -name: Validate Base Gems 1.13.2 tag +name: Validate Base Gems 1.14.4 tag on: push: - tags: ['*.*.*.113021'] + tags: ['*.*.*.114041'] permissions: contents: read actions: read @@ -16,5 +16,5 @@ jobs: run: | set -euo pipefail test "$GITHUB_REF_NAME" = "$(sed -n 's/^mod_version=//p' gradle.properties)" - grep -Fxq 'minecraft_version=1.13.2' gradle.properties + grep -Fxq 'minecraft_version=1.14.4' gradle.properties echo 'Tag validated. Publication uses deploy-release.yml with explicit confirmation.' >> "$GITHUB_STEP_SUMMARY" diff --git a/.gitignore b/.gitignore index 4dc0c8f..78b68bc 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ run /forge-*-changelog.txt secret.json +/local-build.properties # Local agent context and verification evidence /AGENTS.md diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c9806ff..7d8c4e3 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,20 @@ +2.5.0.114041 for Minecraft 1.14.4 + +All 33 gems move to Forge 1.14.4, using OreSpawn 4.1.7.114041. Base Metals +3.0.2.114041 remains optional, and Modern Metals tools can share the gem +crushing recipes. The existing item names, config keys and mining levels stay. + +- Block drops use native loot tables, retaining Fortune, Silk Touch and XP. +- Blast furnaces process gem ore and powder in half the ordinary furnace time. +- Gem trades move to the three Village & Pillage smith professions and restock. +- Molten gems use Forge's fluid renderer, with animated textures and coloured buckets. +- Gem ore overlays use the wider Base Metals spacing to stop flickering at shallow angles. +- Both config entry points use the 1.14 screens. Multiplayer checks Fantasy + Level and gem switches before joining. +- Tagged gems and parts from other mods unlock the recipes that accept them. +- Shield repair stays manual and keeps the shield's name and enchantments. +- Saved gem IDs and the legacy registry snapshot remain available on upgrade. + 2.5.0.113021 for Minecraft 1.13.2 - Pin optional Base Metals compatibility to 3.0.3, with its shared processing and mining fixes. diff --git a/LICENSE-ART.txt b/LICENSE-ART.txt index ad74ad4..27c32f8 100644 --- a/LICENSE-ART.txt +++ b/LICENSE-ART.txt @@ -1,28 +1,32 @@ Base Gems artwork credits -Eejit — primary art contributor to the original template. -Aedda — original Base Gems textures and colours, including storage blocks, +Eejit — primary art contributor to the original template. +Aedda — original Base Gems textures and colours, including storage blocks, ores, gems, powders, nuggets, weapons, tools, armour, doors and trapdoors. https://github.com/MinecraftModDevelopmentMods/BaseGems/commit/632e51853d869d4f6564087e0b4c82c8207d43dd -jmlovelace — redesigned the 33 gem icons (the historical ingot items). +jmlovelace — redesigned the 33 gem icons (the historical ingot items). https://github.com/MinecraftModDevelopmentMods/BaseGems/pull/17 -KiriCattus — adapted the ore art into overlays. +KiriCattus — adapted the ore art into overlays. https://github.com/MinecraftModDevelopmentMods/BaseGems/commit/dc9b80db279accd2d87defce4eff181e0be0bdca -Tinkers' Construct — original molten-metal textures (see LICENSE-TiC.txt). +Tinkers' Construct — original molten-metal textures (see LICENSE-TiC.txt). -Base Metals model templates — Chris Hall (CCHall) for bars, plates and +Base Metals model templates — Chris Hall (CCHall) for bars, plates and doors, and SeqSEE for shields. The templates from Base Metals 2.5.1.111021 are included under the Base Gems namespace. https://www.curseforge.com/minecraft/mc-mods/base-metals/files/9526386 +Bucket fluid and rim masks — reused unchanged from Modern Metals 1.13.2, +under its artwork licence below. No individual artist is named in those files. +https://github.com/MinecraftModDevelopmentMods/ModernMetals/tree/master-1.13.2/src/main/resources/assets/modernmetals/textures/items + Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions. -Section 1 – Definitions. +Section 1 – Definitions. Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image. Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License. @@ -39,7 +43,7 @@ Section 1 – Definitions. Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world. You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning. -Section 2 – Scope. +Section 2 – Scope. License grant. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to: @@ -49,8 +53,8 @@ Section 2 – Scope. Term. The term of this Public License is specified in Section 6(a). Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material. Downstream recipients. - Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License. - Additional offer from the Licensor – Adapted Material. Every recipient of Adapted Material from You automatically receives an offer from the Licensor to exercise the Licensed Rights in the Adapted Material under the conditions of the Adapter’s License You apply. + Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License. + Additional offer from the Licensor – Adapted Material. Every recipient of Adapted Material from You automatically receives an offer from the Licensor to exercise the Licensed Rights in the Adapted Material under the conditions of the Adapter’s License You apply. No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material. No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i). @@ -59,7 +63,7 @@ Section 2 – Scope. Patent and trademark rights are not licensed under this Public License. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties, including when the Licensed Material is used other than for NonCommercial purposes. -Section 3 – License Conditions. +Section 3 – License Conditions. Your exercise of the Licensed Rights is expressly made subject to the following conditions. @@ -79,11 +83,11 @@ Your exercise of the Licensed Rights is expressly made subject to the following ShareAlike. In addition to the conditions in Section 3(a), if You Share Adapted Material You produce, the following conditions also apply. - The Adapter’s License You apply must be a Creative Commons license with the same License Elements, this version or later, or a BY-NC-SA Compatible License. + The Adapter’s License You apply must be a Creative Commons license with the same License Elements, this version or later, or a BY-NC-SA Compatible License. You must include the text of, or the URI or hyperlink to, the Adapter's License You apply. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Share Adapted Material. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, Adapted Material that restrict exercise of the rights granted under the Adapter's License You apply. -Section 4 – Sui Generis Database Rights. +Section 4 – Sui Generis Database Rights. Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material: @@ -93,14 +97,14 @@ Where the Licensed Rights include Sui Generis Database Rights that apply to Your For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights. -Section 5 – Disclaimer of Warranties and Limitation of Liability. +Section 5 – Disclaimer of Warranties and Limitation of Liability. Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You. To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability. -Section 6 – Term and Termination. +Section 6 – Term and Termination. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically. @@ -111,12 +115,12 @@ Section 6 – Term and Termination. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License. Sections 1, 5, 6, 7, and 8 survive termination of this Public License. -Section 7 – Other Terms and Conditions. +Section 7 – Other Terms and Conditions. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License. -Section 8 – Interpretation. +Section 8 – Interpretation. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions. diff --git a/README.md b/README.md index a57ec5d..a342787 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Base Gems for Minecraft 1.13.2 +# Base Gems for Minecraft 1.14.4 Base Gems adds 33 gemstones to Minecraft. Mine agate and amethyst in upper caves, look deeper for ruby and sapphire, or head down near bedrock for black @@ -7,28 +7,30 @@ pieces, tools, weapons and shields. ## Installation -Use Java 8 and Forge **25.0.223 for Minecraft 1.13.2** on both client and +Use Java 8 and Forge **28.2.26 for Minecraft 1.14.4** on both client and server. Base Gems needs MMD OreSpawn and runs without MMDLib. -Use [MMD OreSpawn 4.1.7.113021](https://www.curseforge.com/minecraft/mc-mods/mmd-orespawn/files/9611746) -or a later compatible 1.13.2 release. It includes the fix for checking cave air +Use [MMD OreSpawn 4.1.7.114041](https://github.com/MinecraftModDevelopmentMods/OreSpawn/releases/tag/4.1.7.114041) +or a later compatible 1.14.4 release. It includes the fix for checking cave air at generation boundaries; no separate local engine is needed. Base Metals is optional for a new world. When installed together, use -[Base Metals 3.0.3.113021](https://github.com/MinecraftModDevelopmentMods/BaseMetals/releases/tag/3.0.3.113021) -or a later compatible 1.13.2 release. If your old +[Base Metals 3.0.2.114041](https://github.com/MinecraftModDevelopmentMods/BaseMetals/releases/tag/3.0.2.114041) +or a later compatible 1.14.4 release. If your old world contains Base Metals blocks or items, keep it installed for the upgrade. Gem crushing works with the Base Gems crackhammer on its own. With Base Metals installed its tools and crushers can use the same recipes. With -Modern Metals alone, its crackhammers can use them too. +[Modern Metals 3.0.0.114041](https://github.com/MinecraftModDevelopmentMods/ModernMetals/releases/tag/3.0.0.114041) +alone, its crackhammers can use them too. Both metal mods remain optional; +Base Metals owns shared crushing when both are installed. ## Upgrading a world -Make a separate copy before opening a 1.10.2, 1.11.2 or 1.12.2 world in -1.13.2. Keep the original Forge `level.dat` with the copy. Base Gems uses -that save's registry to restore the gems and their block states during -Minecraft's flattening. [World upgrade details](docs/MIGRATION.md) +Make a separate copy before opening a 1.13.2 world in 1.14.4. Keep the +whole save, including `basegems-legacy-registry.dat` if it is present. Worlds +from 1.10–1.12 should first go through the released Base Gems 1.13.2 upgrade. +[World upgrade details](docs/MIGRATION.md) ## Mining and trading @@ -39,8 +41,8 @@ iron level. A weaker tool breaks the ore without a drop. These are the same mining requirements as in 1.12. Gem ores give XP when mined. Fortune can increase the gem yield, and Silk -Touch lets you take the ore block home. Smiths buy and sell gems for -emeralds, with rarer gems appearing as their careers advance. +Touch lets you take the ore block home. Armourers, toolsmiths and weaponsmiths buy and sell gems for emeralds, +with rarer gems appearing at higher levels. Their offers restock as they work. In High Fantasy, toolsmiths and weaponsmiths also sell gem equipment. OreSpawn handles placement in the Overworld. Amber and moldavite turn up in @@ -55,10 +57,16 @@ changes stone, the background of the gem ores changes with it. Pick up a gem to learn what you can make with it in the recipe book. Some recipes appear when you pick up a processed part, such as a gem plate. -The recipes you learn follow your Fantasy Level and gem settings. -You can smelt gem ore or powder in a furnace to get the gem back. +Tagged gems and parts from other mods teach the same recipes when they can +be used as ingredients. The recipes you learn follow your Fantasy Level and +gem settings. Smelt gem ore or powder in a furnace, or use a blast furnace +for the same result in half the time. -Open **Mods → Base Gems → Config** or choose **Base Gems** from OreSpawn's +Repair a damaged gem shield by putting it and one matching plate in a +crafting grid. Its name and enchantments stay. Repair is a manual recipe +and does not appear in the recipe book. + +Open **Mods → Base Gems → Config** or choose **Base Gems** from OreSpawn's **Mods** list. Both screens save to `config/basegems-common.toml`. Restart the game or server after changing Fantasy Level or switching a gem on or off. Gem switches keep existing blocks and items available in old worlds. @@ -67,8 +75,9 @@ Gem switches keep existing blocks and items available in old worlds. decorative pieces. Player and horse armour are left to add-ons. **Low Fantasy** keeps mining, trades, gem processing, plates and storage blocks. It leaves out recipes for things like ruby doors, gemstone gears and gem tools. -Base Gems has its own Fantasy Level. Use the same setting on the server and -client in multiplayer. +Base Gems has its own Fantasy Level. Multiplayer checks it and all gem +switches before joining; if they differ, the connection message lists the +settings to change. Restart after changing them, then reconnect. ## Mod compatibility @@ -80,9 +89,10 @@ upgrade recipes are not part of this port. ## Development and credits -The 1.13.2 branch uses ForgeGradle 7 and builds a Java 8 mod. +The 1.14.4 branch uses ForgeGradle 7 and builds a Java 8 mod. See [building and Eclipse setup](docs/BUILDING.md) and the -[changelog](CHANGELOG.txt). +[manual testing](docs/MANUAL_TESTING.md), [porting notes](docs/PORTING_114.md) +and the [changelog](CHANGELOG.txt). The gem artwork comes from the 1.12.2 branch. Thanks to Aedda, Eejit, jmlovelace, KiriCattus and the Tinkers' Construct team for their work. diff --git a/build.gradle b/build.gradle index a32a511..9e03877 100644 --- a/build.gradle +++ b/build.gradle @@ -13,8 +13,8 @@ group = project.mod_group version = project.mod_version base.archivesName = 'BaseGems' -if (!(project.version ==~ /\d+\.\d+\.\d+\.113021/)) { - throw new GradleException('Use Major.Minor.Patch.113021 for Minecraft 1.13.2 on Forge.') +if (!(project.version ==~ /\d+\.\d+\.\d+\.114041/)) { + throw new GradleException('Use Major.Minor.Patch.114041 for Minecraft 1.14.4 on Forge.') } // Gradle and Mavenizer use modern JDKs; the mod and game still use Java 8. @@ -118,7 +118,7 @@ repositories { metadataSources { artifact() } } } - filter { includeModule('zone.moddev.mc.basemetals', 'BaseMetals') } + filter { includeModule('zone.moddev.mc.basemetals', 'BaseMetals'); includeModule('zone.moddev.mc.orespawn', 'OreSpawn'); includeModule('zone.moddev.mc.modernmetals', 'ModernMetals') } } exclusiveContent { forRepository { maven { url = 'https://repo.spongepowered.org/repository/maven-public' } } @@ -190,6 +190,9 @@ tasks.register('verifyFluidRegistration', Exec) { } tasks.named('check') { dependsOn 'verifyFluidRegistration' } -apply from: 'gradle/release-113.gradle' +apply from: 'gradle/release-114.gradle' apply from: 'gradle/normalize-javadoc-trees.gradle' + +apply from: 'gradle/verification-114.gradle' +apply from: 'gradle/compatibility-114.gradle' diff --git a/docs/BUILDING.md b/docs/BUILDING.md index 67fd720..3dd1e49 100644 --- a/docs/BUILDING.md +++ b/docs/BUILDING.md @@ -1,30 +1,59 @@ -# Building Base Gems for Minecraft 1.13.2 +# Building Base Gems for Minecraft 1.14.4 Use Java 17 to run Gradle 9.6.1, Java 25 for ForgeGradle's Mavenizer, and Java 8 for compilation and Minecraft. Put Java 17 on your command path and make the other JDKs available to Gradle's toolchain detection. Python 3 -stages the pinned OreSpawn and optional Base Metals jars, checks their SHA-256 +stages the pinned OreSpawn, Base Metals and Modern Metals jars, checks their SHA-256 and generates the resource pack and data pack. +Use Python 3.10 or later. If Eclipse cannot find it on its PATH, create an +ignored `local-build.properties` in the project root: + +```properties +pythonExecutable=C:/path/to/python.exe +``` + +That setting applies to both Gradle refreshes in Eclipse and terminal builds. +An explicit `-PpythonExecutable=...` still takes precedence. + From the inner Git checkout on Windows: ```powershell python gradle/stage-legacy-dependencies.py .gradle/legacy-dependencies -.\gradlew.bat check build verify113ReleaseArtifacts write113ReleaseChecksums prepareEclipse +.\gradlew.bat check build verify114ReleaseArtifacts write114ReleaseChecksums prepareEclipse ``` On Linux or macOS, use `python3` and `./gradlew`. The game jar is -`build/libs/BaseGems-2.5.0.113021.jar`. The build uses Forge 25.0.223 and -MCP snapshot 20180921-1.13. Model, recipe, tag, language and advancement data +`build/libs/BaseGems-2.5.0.114041.jar`. The build uses Forge 28.2.26 and +MCP snapshot 20190719-1.14.3. Model, recipe, tag, language and advancement data is generated during resource processing. `prepareEclipse` generates the Eclipse project and Java 8 launches with processed resources and the pinned runtime dependencies. Use the same Gradle cache for Eclipse and command-line builds. -The optional Base Metals integration is pinned to its public MMD Maven release -3.0.3.113021. Run `prepareEclipse` again after changing sources or resources. +The optional metal integrations use the published Base Metals 3.0.2.114041 and +Modern Metals 3.0.0.114041 releases. Run `prepareEclipse` again after changing +sources or resources. Use a fresh test world when checking the OreSpawn defaults. In Low Fantasy, try mining and trading a gem, then check that storage blocks are still craftable and equipment recipes have gone. See [ore generation](ORE_GENERATION.md) for the placement rules and config overrides. + +`prepareEclipse` generates four isolated clients: `runClient.launch`, +`runClientWithBaseMetals.launch`, `runClientWithModernMetals.launch` and +`runClientWithBaseAndModern.launch`. Each has its own run folder. Replaced +companion jars are retained under `.gradle/retired-compatibility-jars`; saves, +config and unrelated mods are preserved. + +To test a different local Modern Metals build, supply its mapped development +jar explicitly. Release builds always use the published dependency: + +```powershell +.\gradlew.bat prepareEclipse "-PmodernMetalsDevelopmentJar=C:/path/ModernMetals-3.0.0.114041-deobf.jar" +``` + +`runProbeServer` and `runProbeClient` are explicit automated checks. Use a +new `-PprobeDirectory=run/verification/` for each scenario and keep +their receipts. Ordinary launches exclude these test mods. +See [manual testing](MANUAL_TESTING.md) and [porting notes](PORTING_114.md). diff --git a/docs/MANUAL_TESTING.md b/docs/MANUAL_TESTING.md new file mode 100644 index 0000000..a5e8236 --- /dev/null +++ b/docs/MANUAL_TESTING.md @@ -0,0 +1,48 @@ +# Testing Base Gems 1.14.4 + +Use Java 8, Forge 28.2.26 and OreSpawn 4.1.7.114041. The game jar is +`build/libs/BaseGems-2.5.0.114041.jar`. Base Metals 3.0.2.114041 is optional; +the local Modern Metals 1.14.4 candidate can be tested alongside it. + +After `prepareEclipse`, choose a normal launch: + +- `runClient.launch`: Base Gems and OreSpawn. +- `runClientWithBaseMetals.launch`: adds published Base Metals. +- `runClientWithModernMetals.launch`: adds the supplied local Modern Metals jar. +- `runClientWithBaseAndModernMetals.launch`: loads all three material mods. + +The latter two are generated when `modernMetalsDevelopmentJar` is supplied. +Use the matching versions in a separate launcher instance if testing packaged +jars. Avoid duplicate copies of the same mod. + +Start with a fresh Survival player. Pick up gems, nuggets, rods and storage +blocks and check their recipe-book entries. A tagged equivalent from another +mod should teach the recipes that accept it. Test both ordinary and blast +furnaces; the blast furnace should take half the time. Check gem crushing +with a gem hammer, then the available Base Metals and Modern Metals hammers. + +Mine several gems with the required tool level, Fortune and Silk Touch. +Ordinary mining should give gems and XP; Silk Touch gives the ore without +XP. Check a door, slab, double slab and plate for their correct drops. + +Damage a named or enchanted gem shield. One matching plate in a crafting +grid should fully repair it and keep its other data. The repair itself +should not appear in the recipe book. Try bows, bolts and crossbows, a +fishing rod and a filled bucket as well. + +Visit an armourer, toolsmith and weaponsmith. Check gem offers, emerald +prices, restocking and progression. Armour remains left to add-ons. + +Open the config from both Mods and OreSpawn. Test the gem pages, Done, +Cancel and returning to the parent screen. Restart after changing Fantasy +Level or a gem switch. Low Fantasy should retain mining, processing, plates, +storage and gem trades while hiding equipment and decorative recipes. + +For multiplayer, use the same Fantasy Level and gem switches on both sides. +Change one client setting, restart and reconnect: the connection should +stop before joining and name the required TOML key and server value. +Restore it and restart before reconnecting. + +Use a copy for world upgrades. Keep the legacy registry sidecar, then check +placed gems, door states, inventories, buckets and worn equipment. Save, +leave and reopen the copy. See [migration](MIGRATION.md). diff --git a/docs/MIGRATION.md b/docs/MIGRATION.md index 5c49c36..befaf3b 100644 --- a/docs/MIGRATION.md +++ b/docs/MIGRATION.md @@ -1,30 +1,21 @@ -# Upgrading Base Gems worlds to 1.13.2 +# Upgrading Base Gems worlds to 1.14.4 -1. Close Minecraft or stop the old server. Copy the whole world directory - before upgrading. Keep the original save and its mods available. -2. Use Java 8 and Forge 25.0.223. Install the 1.13.2 versions of Base Gems and - MMD OreSpawn, plus 1.13.2 ports of the other mods that placed blocks or - items in the world. The migration only handles Base Gems content. For - worlds with Base Metals, use its 1.13.2 version too. -3. Open the copy. Use Optimize World or the server's `--forceUpgrade` option - to convert every region at once. Normal loading converts chunks as you - visit them. Keep the `basegems-legacy-registry.dat` file that Base Gems - writes in the save, especially if some old chunks are still unvisited. -4. Check the places and inventories that matter to you and keep the old - save until you're happy with the upgrade. +Close the game and copy the whole save. Install the 1.14.4 versions of Base +Gems, OreSpawn and every other mod that owns blocks or items in the world. +Open the copy with Java 8 and Forge 28.2.26. Keep the original until you have +checked your builds and inventories. -Minecraft 1.13 replaces numeric block IDs and metadata with named block -states. Base Gems reads the IDs assigned to the world, including the -Forge snapshot in `level.dat_old` when needed. It preserves the old gem -names and restores settings such as slab halves, stair facing, plate -orientation, fluid levels and the hinge and opening on both halves of a -door. Old universal buckets containing molten gems become named gem -buckets. Item counts, tool damage and existing item tags are carried over. +For worlds from 1.10–1.12, first use released Base Gems 2.5.0.113021 on +Minecraft 1.13.2. Keep `basegems-legacy-registry.dat` with that world when +moving on to 1.14, especially if some old chunks remain unvisited. The 1.14 +port retains the old block and item names, fluid and bucket IDs, named block +states and the legacy snapshot reader. Both old double-slab blocks and +ordinary slabs remain registered. -Base Gems creates a `*.basegems-legacy-backup` next to any level or player -file it needs to rewrite. Minecraft writes converted chunks in place. The -untouched copy of the original world is what you need if you want to go back. +Use Optimize World or the server's `--forceUpgrade` option to convert every +region at once. Reopen the copy and check the places and inventories that +matter to you. OreSpawn keeps its world profile; gem rules retain their old +IDs, so upgrading does not create a second family of deposits. -Set Fantasy Level and gem switches in the new Mods config screen after -the upgrade. The old `BaseGems.cfg` is a reference for the settings you used -before. OreSpawn owns its saved world profiles. +The focused test receipt records the copied world used for automated checks. +It does not replace a backup or manual acceptance of your own modpack. diff --git a/docs/PORTING_114.md b/docs/PORTING_114.md new file mode 100644 index 0000000..2b1852b --- /dev/null +++ b/docs/PORTING_114.md @@ -0,0 +1,50 @@ +# Minecraft 1.14.4 port + +This port starts from released Base Gems 1.13.2 at `a89b4444`. Modern Metals +1.14.4 supplies working Forge 28 examples. Gem properties, mining levels, +saved names and the deposit distribution stay with Base Gems. + +- Forge 28.2.26, MCP snapshot 20190719-1.14.3 and config 20190829.143755. + Gradle uses Java 17, Mavenizer uses Java 25, and compilation and Minecraft + still use Java 8. +- All solid blocks have native loot tables. Ore drops retain Fortune and + Silk Touch, with no XP from Silk Touch. Doors drop from their lower half; + double slabs yield two ordinary slabs. Fluids have empty loot tables. +- Recipe types and serializers use Forge 28's registries and crafting + inventories. Blast furnaces process the same ore and powder as ordinary + furnaces at half the cooking time. Shared crushing keeps each recipe ID. +- Smith trades use the armorer, toolsmith and weaponsmith professions. + Gem rarity, bundles and prices carry over, with villager XP and restocking. +- Native fluid attributes supply animated still/flow textures and gem + colours. The old fluid-renderer coremod is removed. Fluid construction + stays in sequential registration, before blocks and buckets need it. +- Both configuration entry points use native 1.14 screens. The common TOML + file and every key stay unchanged. Fantasy Level remains Base Gems' own + setting, latched until restart. A login handshake checks it and all gem + switches before the client receives recipes. +- Tag-based recipes also discover through their tags. Shield repair stays + manual because the recipe book cannot place damaged equipment reliably. +- The legacy registry snapshot and old IDs remain. World hooks target the + 1.14 save/chunk loader, with `full` as the completed chunk status. The + obsolete Forge 25 leaves-fixer patch is removed. +- OreSpawn 4.1.7.114041 owns generation. The 33 existing rule IDs, heights, + patterns, hosts and rarity settings are unchanged. Generation remains + Overworld-only, with retrogen off. No fallback generator or terrain engine + was added. +- Ore overlays use Base Metals' corrected 0.05 model-unit separation from + the stone layer, with explicit 0..16 face UVs to keep sampling inside each + texture sprite. The shared template generates all 33 block and item models. + +References: [Forge's porting notes](https://docs.minecraftforge.net/en/1.14.x/legacy/porting1214/), +the exact mapped Forge 28 sources, and +[OreSpawn 4.1.7.114041](https://github.com/MinecraftModDevelopmentMods/OreSpawn/releases/tag/4.1.7.114041). + +The build checks generated data, startup ordering, Java 8 artifacts and +metadata. Explicit server/client probes cover native loot, recipes, discovery, +trades, fluids, models and saving/reopening. They live in separate source +sets and are excluded from player jars and ordinary launches. Expensive +gameplay checks run locally; CI builds and audits the candidate. + +Manual acceptance and publication remain separate steps. See the local +verification receipt for the exact jars, copied-world comparisons and retained +failed attempts, and [manual testing](MANUAL_TESTING.md) for the playtest. diff --git a/docs/RELEASING.md b/docs/RELEASING.md index 8d29cc1..1f1e2e3 100644 --- a/docs/RELEASING.md +++ b/docs/RELEASING.md @@ -1,16 +1,16 @@ -# Releasing Base Gems for Minecraft 1.13.2 +# Releasing Base Gems for Minecraft 1.14.4 Build with Java 17, Temurin 8u502-b07 for compilation and Java 25 for -Mavenizer. Run check, build, verify113ReleaseArtifacts, -write113ReleaseChecksums, genEclipseRuns and eclipse. Keep the packaged +Mavenizer. Run check, build, verify114ReleaseArtifacts, +write114ReleaseChecksums, genEclipseRuns and eclipse. Keep the packaged gameplay and saved-world checks local, then complete manual testing. -Open a PR from the fork to MMD's master-1.13.2. After merging, wait for the -successful push CI run and download BaseGems-1.13.2-. Compare +Open a PR from the fork to MMD's `master-1.14.4`. After merging, wait for the +successful push CI run and download BaseGems-1.14.4-. Compare all three jars with the locally qualified bundle. The CI bundle contains the player, sources and Javadoc jars, SHA256SUMS and CHANGELOG.txt. -Run deploy-release.yml on master-1.13.2 with the release version, full merged +Run deploy-release.yml on master-1.14.4 with the release version, full merged commit and qualified game-jar SHA-256. Leave confirm_live_publication false for verification. Set it true only when publication is authorised. The workflow checks the branch tip, successful merged CI and bundle hashes, @@ -25,4 +25,4 @@ Verify anonymous downloads and hashes on all three services, including the CurseForge dependency metadata. If a publication job fails, preserve its logs and retry only the failed job; do not duplicate an accepted upload. Base Metals is optional and OreSpawn is required. Publish Base Metals first -and keep the compatibility pin on its public 1.13.2 release. +and keep the compatibility pin on its public 1.14.4 release. diff --git a/gradle.properties b/gradle.properties index f6c034a..ae88cc7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,13 +4,13 @@ org.gradle.configuration-cache=false org.gradle.caching=true org.gradle.parallel=false net.minecraftforge.gradle.merge-source-sets=false -minecraft_version=1.13.2 -forge_version=25.0.223 +minecraft_version=1.14.4 +forge_version=28.2.26 mappings_channel=snapshot -mappings_version=20180921-1.13 +mappings_version=20190719-1.14.3 mod_id=basegems mod_group=zone.moddev.mc.basegems -mod_version=2.5.0.113021 +mod_version=2.5.0.114041 mod_artifact=BaseGems loader_name=forge loader_code=1 @@ -20,6 +20,9 @@ java_setup_version=8.0.502+7 gradle_java_version=17 gradle_java_setup_version=17.0.1+12 mavenizer_java_version=25.0.3+9 -orespawn_version=4.1.7.113021 -orespawn_version_range=[4.1.7.113021,5.0.0) -mcp_version=20190213.203750 +orespawn_version=4.1.7.114041 +orespawn_version_range=[4.1.7.114041,5.0.0) +mcp_version=20190829.143755 + +basemetals_version=3.0.2.114041 +modernmetals_version=3.0.0.114041 diff --git a/gradle/compatibility-114.gradle b/gradle/compatibility-114.gradle new file mode 100644 index 0000000..2e395f3 --- /dev/null +++ b/gradle/compatibility-114.gradle @@ -0,0 +1,121 @@ +import groovy.json.JsonSlurper +import groovy.xml.XmlParser +import groovy.xml.XmlUtil +import java.nio.file.Files +import java.nio.file.StandardCopyOption +import java.security.MessageDigest +import java.util.zip.ZipFile + +def published = new JsonSlurper().parse(file('gradle/dependencies.json')).collectEntries { [(it.id): it] } +configurations { + baseMetalsDevelopment { canBeConsumed = false; transitive = false } + modernMetalsDevelopment { canBeConsumed = false; transitive = false } +} +dependencies { + baseMetalsDevelopment renamer.dependency(published.basemetals.coordinate) + modernMetalsDevelopment renamer.dependency(published.modernmetals.coordinate) +} +def modernOverride = providers.gradleProperty('modernMetalsDevelopmentJar') +if (providers.gradleProperty('releaseBuild').getOrElse('false').toBoolean() && modernOverride.isPresent()) + throw new GradleException('Release builds must use the published Modern Metals candidate') +def selectedModern = { modernOverride.isPresent() ? file(modernOverride.get()) : configurations.modernMetalsDevelopment.singleFile } +def profiles = [Standalone: ['', []], WithBaseMetals: ['with-basemetals', ['base']], WithModernMetals: ['with-modernmetals', ['modern']], + WithBaseAndModern: ['with-base-and-modern', ['base', 'modern']]] +def hash = { File f -> MessageDigest.getInstance('SHA-256').digest(f.bytes).encodeHex().toString() } +def companion = { File f -> + if (!f.name.toLowerCase(Locale.ROOT).endsWith('.jar')) return false + if (f.name ==~ /(?i)(BaseMetals-|base-metals-240967-|ModernMetals-).+\.jar/) return true + new ZipFile(f).withCloseable { z -> + def e = z.getEntry('META-INF/mods.toml') + e && (z.getInputStream(e).getText('UTF-8') =~ /modId\s*=\s*"(?:basemetals|modernmetals)"/).find() + } +} +def selected = { kinds -> + Map result = [:] + if (kinds.contains('base')) result["BaseMetals-${project.basemetals_version}-mapped.jar".toString()] = configurations.baseMetalsDevelopment.singleFile + if (kinds.contains('modern')) result["ModernMetals-${project.modernmetals_version}-mapped.jar".toString()] = selectedModern() + result +} +def prepare = tasks.register('prepareCompatibilityMods') { + dependsOn configurations.baseMetalsDevelopment, configurations.modernMetalsDevelopment, 'verifyReleaseDependencies' + doLast { + profiles.each { label, spec -> + File mods = file('run/' + spec[0] + '/mods').canonicalFile + if (!mods.toPath().startsWith(file('run').canonicalFile.toPath())) throw new GradleException('Unsafe mod directory') + mods.mkdirs() + Map expected = selected(spec[1]) + mods.listFiles().findAll { it.isFile() && companion(it) && (!expected.containsKey(it.name) || hash(it) != hash(expected[it.name])) }.each { stale -> + File retained = file('.gradle/retired-compatibility-jars/' + label + '/' + hash(stale) + '-' + stale.name).canonicalFile + if (!retained.toPath().startsWith(file('.gradle/retired-compatibility-jars').canonicalFile.toPath())) throw new GradleException('Unsafe retention path') + retained.parentFile.mkdirs() + Files.copy(stale.toPath(), retained.toPath(), StandardCopyOption.REPLACE_EXISTING) + if (hash(retained) != hash(stale)) throw new GradleException('Retained companion differs') + Files.delete(stale.toPath()) + } + expected.each { name, source -> + File target = new File(mods, name) + if (!target.isFile() || hash(target) != hash(source)) Files.copy(source.toPath(), target.toPath(), StandardCopyOption.REPLACE_EXISTING) + if (hash(target) != hash(source)) throw new GradleException('Staged companion differs: ' + target) + } + } + } +} +tasks.register('generateCompatibilityRuns') { + dependsOn 'genEclipseRuns', prepare + doLast { + String template = file('runClient.launch').getText('UTF-8') + profiles.each { label, spec -> + Node launch = new XmlParser().parseText(template) + launch.stringAttribute.find { it.attribute('key') == 'org.eclipse.jdt.launching.WORKING_DIRECTORY' } + .attributes().put('value', file('run/' + spec[0]).absolutePath) + Node cp = launch.listAttribute.find { it.attribute('key') == 'org.eclipse.jdt.launching.CLASSPATH' } + def jre = cp.listEntry.findAll { it.attribute('value').contains('org.eclipse.jdt.launching.JRE_CONTAINER') }.toList() + def launchers = cp.listEntry.collect { new XmlParser().parseText(it.attribute('value')) } + .findAll { it.attribute('externalArchive')?.contains('slime-launcher-') }.collect { file(it.attribute('externalArchive')) } + cp.children().clear() + (sourceSets.main.runtimeClasspath.files + launchers).findAll { !companion(it) }.unique().each { f -> + Node entry = new Node(null, 'runtimeClasspathEntry', [externalArchive: f.absolutePath, type: '2', path: '5']) + new Node(cp, 'listEntry', [value: XmlUtil.serialize(entry)]) + } + jre.each { cp.append(it) } + file(label == 'Standalone' ? 'runClient.launch' : 'runClient' + label + '.launch').setText(XmlUtil.serialize(launch), 'UTF-8') + } + } +} +tasks.register('verifyEclipseProfiles') { + dependsOn 'generateCompatibilityRuns' + doLast { + profiles.keySet().collect { it == 'Standalone' ? 'runClient.launch' : 'runClient' + it + '.launch' }.each { name -> + Node launch = new XmlParser().parse(file(name)) + if (!launch.booleanAttribute.any { it.attribute('key') == 'org.eclipse.jdt.launching.ATTR_EXCLUDE_TEST_CODE' && it.attribute('value') == 'true' }) + throw new GradleException('Manual profile includes test code: ' + name) + } + profiles.each { label, spec -> + File mods = file('run/' + spec[0] + '/mods') + Map expected = selected(spec[1]) + def actual = mods.listFiles().findAll { it.isFile() && companion(it) } + if (actual.collect { it.name }.sort() != expected.keySet().toList().sort()) throw new GradleException('Wrong companions in ' + label) + actual.each { if (hash(it) != hash(expected[it.name])) throw new GradleException('Wrong jar in ' + label) } + } + } +} +tasks.register('configureEclipseBuildship') { + doLast { + File target = file('.settings/org.eclipse.buildship.core.prefs') + target.parentFile.mkdirs() + Properties settings = new Properties() + ['eclipse.preferences.version': '1', 'connection.gradle.distribution': 'GRADLE_DISTRIBUTION(WRAPPER)', + 'connection.gradle.user.home': gradle.gradleUserHomeDir.canonicalPath, 'connection.project.dir': '', + 'gradle.user.home': gradle.gradleUserHomeDir.canonicalPath, 'override.workspace.settings': 'true', + 'java.home': new File(System.getProperty('java.home')).canonicalPath].each { key, value -> settings.setProperty(key, value) } + target.withOutputStream { settings.store(it, 'Base Gems Buildship configuration') } + } +} + +eclipse.classpath.file.whenMerged { classpath -> + classpath.entries.findAll { it.path?.startsWith('src/integrationTest/') || it.path?.startsWith('src/clientIntegrationTest/') } + .each { it.entryAttributes['test'] = 'true' } +} + +tasks.named('prepareEclipse') { dependsOn 'verifyEclipseProfiles', 'configureEclipseBuildship' } +tasks.named('check') { dependsOn 'verifyEclipseProfiles' } diff --git a/gradle/dependencies.json b/gradle/dependencies.json index da51165..f6a3519 100644 --- a/gradle/dependencies.json +++ b/gradle/dependencies.json @@ -1,16 +1,23 @@ [ { "id": "orespawn", - "coordinate": "curse.maven:mmd-orespawn-245586:9611746", - "repository": "https://www.cursemaven.com", - "sha256": "E65DCCA0623A20111C40779CB0FE2078E98C618FAA68F79C9A28E1E53C63957E", + "coordinate": "zone.moddev.mc.orespawn:OreSpawn:4.1.7.114041", + "repository": "https://maven.moddev.zone/releases", + "sha256": "C6171543240D43CD6273601D537D46A8F8C8A8B5992B258827E2F6F713AB7D44", "runtime": true }, { "id": "basemetals", - "coordinate": "zone.moddev.mc.basemetals:BaseMetals:3.0.3.113021", + "coordinate": "zone.moddev.mc.basemetals:BaseMetals:3.0.2.114041", "repository": "https://maven.moddev.zone/releases", - "sha256": "88B9DB908249B9CD7E415F5577311ED03A22CF6BF17800688F67FC65F6BE2ECD", + "sha256": "11C0C4A6FE26B22EE794EA76CD6E0F1C5B65FB03540F9E8E0C52425CFEFB062B", "runtime": false + }, + { + "id": "modernmetals", + "coordinate": "zone.moddev.mc.modernmetals:ModernMetals:3.0.0.114041", + "repository": "https://maven.moddev.zone/releases", + "runtime": false, + "sha256": "22942EBC37BE76D940EA6EFCA53DA6E47085D72EAD95D348DE70D7526389683B" } ] diff --git a/gradle/eclipse.gradle b/gradle/eclipse.gradle index 10cda04..528010d 100644 --- a/gradle/eclipse.gradle +++ b/gradle/eclipse.gradle @@ -23,6 +23,9 @@ tasks.named('genEclipseRuns') { xml = match.replaceFirst(Matcher.quoteReplacement(option + ' "' + argument + '"' + next)) } } + if (!xml.contains('org.eclipse.jdt.launching.ATTR_EXCLUDE_TEST_CODE')) { + xml = xml.replace('', '') + } launch.setText(xml, 'UTF-8') } } diff --git a/gradle/generate-resources.py b/gradle/generate-resources.py index 21c44c7..3ebe622 100644 --- a/gradle/generate-resources.py +++ b/gradle/generate-resources.py @@ -1,4 +1,4 @@ -"""Translate the legacy art and build the data pack for Forge 25.""" +"""Translate the legacy art and build the data pack for Forge 28.""" from pathlib import Path import json @@ -62,7 +62,7 @@ def convert_models(): for gem in GEMS: asset(f"blockstates/{gem}.json", {"variants": {"": {"model": "basegems:block/molten_gem"}}}) asset(f"models/item/{gem}.json", generated_model(f"basegems:items/{gem}_ingot")) - asset(f"models/item/{gem}_bucket.json", generated_model("minecraft:item/lava_bucket")) + asset(f"models/item/{gem}_bucket.json", {"parent": "minecraft:item/generated", "textures": {"layer0": "minecraft:item/bucket", "layer1": "basegems:items/bucket_fluid", "layer2": "basegems:items/bucket_overlay"}}) for form in FORMS: path = f"{gem}_{form}" if form == "door": @@ -74,7 +74,7 @@ def convert_models(): "wall": "_wall_inventory", "pressure_plate": "_pressure_plate_up"}.get(form, "_" + form) model = {"parent": "basegems:block/" + gem + suffix} asset(f"models/item/{path}.json", model) - asset("models/block/molten_gem.json", {"textures": {"particle": "basegems:blocks/molten_metal_still"}}) + asset("models/block/molten_gem.json", {"textures": {"particle": "basegems:block/molten_metal_still"}}) def convert_languages(): @@ -94,6 +94,7 @@ def convert_languages(): for gem in GEMS: name = values.get(f"item.basegems.{gem}_ingot", gem) values[f"item.basegems.{gem}_bucket"] = values.get(f"fluid.basegems.{gem}", name) + " Bucket" + values.setdefault("config.basegems.connection.mismatch", "Base Gems settings differ from this server. Set these values in config/basegems-common.toml, then restart Minecraft and reconnect: %s") asset(f"lang/{path.stem.lower()}.json", values) @@ -115,12 +116,15 @@ def game_data(kind, path, data): def advancement(gem, name, trigger): recipe = f"basegems:{gem}_{name}" + predicate = {"ingot": tag("gems", gem), "nugget": tag("nuggets", gem), + "block": tag("storage_blocks", gem), "rod": tag("rods", gem), + "plate": tag("plates", gem)}.get(trigger, item(gem, trigger)) game_data("advancements/recipes", f"{gem}_{name}", { "parent": "minecraft:recipes/root", "rewards": {"recipes": [recipe]}, "criteria": { "has_ingredient": {"trigger": "minecraft:inventory_changed", - "conditions": {"items": [item(gem, trigger)]}}, + "conditions": {"items": [predicate]}}, "has_recipe": {"trigger": "minecraft:recipe_unlocked", "conditions": {"recipe": recipe}}, }, "requirements": [["has_ingredient", "has_recipe"]], @@ -181,11 +185,13 @@ def shapeless(name, form, count, trigger, ingredient): shaped("bars", 4, "rod", "xxx", {"x": rod}, name="bars_from_rods") game_data("recipes", f"{gem}_repair_shield", {"type": "basegems:plate_repair", "target": f"basegems:{gem}_shield", "plate": tag("plates", gem)}) - advancement(gem, "repair_shield", "plate") for form in ("ore", "powder"): game_data("recipes", f"{gem}_{form}_smelting", {"type": "basegems:smelting", "ingredient": item(gem, form), "result": item(gem, "ingot"), "experience": 0.45}) advancement(gem, f"{form}_smelting", form) + game_data("recipes", f"{gem}_{form}_blasting", {"type": "basegems:blasting", + "ingredient": item(gem, form), "result": item(gem, "ingot"), "experience": 0.45}) + advancement(gem, f"{form}_blasting", form) for form, result, count in (("ore", "powder", 2), ("ingot", "powder", 1), ("block", "powder", 9), ("nugget", "smallpowder", 1)): game_data("recipes", f"{gem}_{form}_crushing", {"type": "basegems:crushing", @@ -211,8 +217,37 @@ def generate_tags(): {"replace": False, "values": [f"basegems:{gem}_arrow" for gem in GEMS]}) +def loot(gem): + for form in FORMS: + block = f"basegems:{gem}_{form}" + entry = {"type": "minecraft:item", "name": block} + conditions = [{"condition": "minecraft:survives_explosion"}] + if form == "door": + conditions.append({"condition": "minecraft:block_state_property", "block": block, + "properties": {"half": "lower"}}) + if form == "slab": + entry["functions"] = [{"function": "minecraft:set_count", "count": 2, "conditions": [ + {"condition": "minecraft:block_state_property", "block": block, "properties": {"type": "double"}}]}] + if form == "ore": + entry = {"type": "minecraft:alternatives", "children": [ + {"type": "minecraft:item", "name": block, "conditions": [{"condition": "minecraft:match_tool", + "predicate": {"enchantments": [{"enchantment": "minecraft:silk_touch", "levels": {"min": 1}}]}}]}, + {"type": "minecraft:item", "name": f"basegems:{gem}_ingot", "functions": [ + {"function": "minecraft:apply_bonus", "enchantment": "minecraft:fortune", "formula": "minecraft:ore_drops"}, + {"function": "minecraft:explosion_decay"}]}]} + conditions = [] + game_data("loot_tables/blocks", f"{gem}_{form}", {"type": "minecraft:block", "pools": [ + {"rolls": 1, "entries": [entry], "conditions": conditions}]}) + game_data("loot_tables/blocks", f"double_{gem}_slab", {"type": "minecraft:block", "pools": [ + {"rolls": 1, "entries": [{"type": "minecraft:item", "name": f"basegems:{gem}_slab", + "functions": [{"function": "minecraft:set_count", "count": 2}]}], + "conditions": [{"condition": "minecraft:survives_explosion"}]}]}) + game_data("loot_tables/blocks", gem, {"type": "minecraft:block", "pools": []}) + + convert_models() convert_languages() generate_tags() for gem in GEMS: crafting(gem) + loot(gem) diff --git a/gradle/model-templates.json b/gradle/model-templates.json index 52a8aa6..911b90c 100644 --- a/gradle/model-templates.json +++ b/gradle/model-templates.json @@ -1690,64 +1690,76 @@ "faces": { "down": { "texture": "#base", + "uv": [0, 0, 16, 16], "cullface": "down" }, "up": { "texture": "#base", + "uv": [0, 0, 16, 16], "cullface": "up" }, "north": { "texture": "#base", + "uv": [0, 0, 16, 16], "cullface": "north" }, "south": { "texture": "#base", + "uv": [0, 0, 16, 16], "cullface": "south" }, "west": { "texture": "#base", + "uv": [0, 0, 16, 16], "cullface": "west" }, "east": { "texture": "#base", + "uv": [0, 0, 16, 16], "cullface": "east" } } }, { "from": [ - -0.001, - -0.001, - -0.001 + -0.05, + -0.05, + -0.05 ], "to": [ - 16.001, - 16.001, - 16.001 + 16.05, + 16.05, + 16.05 ], "faces": { "down": { "texture": "#overlay", + "uv": [0, 0, 16, 16], "cullface": "down" }, "up": { "texture": "#overlay", + "uv": [0, 0, 16, 16], "cullface": "up" }, "north": { "texture": "#overlay", + "uv": [0, 0, 16, 16], "cullface": "north" }, "south": { "texture": "#overlay", + "uv": [0, 0, 16, 16], "cullface": "south" }, "west": { "texture": "#overlay", + "uv": [0, 0, 16, 16], "cullface": "west" }, "east": { "texture": "#overlay", + "uv": [0, 0, 16, 16], "cullface": "east" } } diff --git a/gradle/release-113.gradle b/gradle/release-114.gradle similarity index 80% rename from gradle/release-113.gradle rename to gradle/release-114.gradle index 10d47ea..bc13147 100644 --- a/gradle/release-113.gradle +++ b/gradle/release-114.gradle @@ -37,13 +37,13 @@ tasks.withType(Javadoc).configureEach { tasks.named('jar', Jar) { manifest.attributes('Implementation-Title': archiveName, 'Implementation-Version': project.version, 'Maven-Artifact': "${expectedGroup}:${archiveName}:${project.version}".toString(), - 'Build-Target': 'minecraft-1.13.2-forge-25.0.223-java-8') + 'Build-Target': 'minecraft-1.14.4-forge-28.2.26-java-8') } tasks.named('assemble') { dependsOn playerJar, tasks.named('sourcesJar'), tasks.named('javadocJar') } def sha256 = { File file -> MessageDigest.getInstance('SHA-256').digest(file.bytes).encodeHex().toString() } def audit = { File directory -> - if (project.group.toString() != expectedGroup || !(project.version.toString() ==~ /\d+\.\d+\.\d+\.113021/)) { + if (project.group.toString() != expectedGroup || !(project.version.toString() ==~ /\d+\.\d+\.\d+\.114041/)) { throw new GradleException('Wrong Maven or Minecraft release identity') } if (directory.listFiles().findAll { it.name.endsWith('.jar') }.collect { it.name }.sort() != releaseNames.sort(false)) { @@ -76,8 +76,8 @@ def audit = { File directory -> String metadata = zip.getInputStream(zip.getEntry('META-INF/mods.toml')).getText('UTF-8') if (metadata.contains('${') || !metadata.contains('modId="' + modId + '"') || !metadata.contains('version="' + project.version + '"') - || !metadata.contains('versionRange="[1.13.2]"') - || !metadata.contains('versionRange="[4.1.7.113021,5.0.0)"')) { + || !metadata.contains('versionRange="[1.14.4]"') + || !metadata.contains('versionRange="[4.1.7.114041,5.0.0)"')) { throw new GradleException('Wrong or unresolved release mod metadata') } } @@ -85,14 +85,14 @@ def audit = { File directory -> } } -tasks.register('verify113ReleaseArtifacts') { +tasks.register('verify114ReleaseArtifacts') { group = 'verification' dependsOn tasks.named('assemble'), tasks.named('check') doLast { audit(layout.buildDirectory.dir('libs').get().asFile) } } -tasks.register('write113ReleaseChecksums') { +tasks.register('write114ReleaseChecksums') { group = 'verification' - dependsOn tasks.named('verify113ReleaseArtifacts') + dependsOn tasks.named('verify114ReleaseArtifacts') doLast { File output = layout.buildDirectory.file('release/SHA256SUMS').get().asFile output.parentFile.mkdirs() @@ -101,7 +101,7 @@ tasks.register('write113ReleaseChecksums') { }.join('\n') + '\n', 'UTF-8') } } -tasks.register('verify113PreparedReleaseArtifacts') { +tasks.register('verify114PreparedReleaseArtifacts') { group = 'verification' doLast { if (!preparedDirectory.isPresent()) throw new GradleException('preparedReleaseDir is required') @@ -145,7 +145,7 @@ publishing { } pom { name = 'Base Gems' - description = 'Base Gems for Minecraft 1.13.2, using Forge 25 and OreSpawn 4.' + description = 'Base Gems for Minecraft 1.14.4, using Forge 28 and OreSpawn 4.' url = 'https://github.com/MinecraftModDevelopmentMods/BaseGems' licenses { license { @@ -158,8 +158,17 @@ publishing { def dependency = asNode().appendNode('dependencies').appendNode('dependency') dependency.appendNode('groupId', 'zone.moddev.mc.basemetals') dependency.appendNode('artifactId', 'BaseMetals') - dependency.appendNode('version', '3.0.3.113021') + dependency.appendNode('version', '3.0.2.114041') dependency.appendNode('optional', 'true') + def modern = dependency.parent().appendNode('dependency') + modern.appendNode('groupId', 'zone.moddev.mc.modernmetals') + modern.appendNode('artifactId', 'ModernMetals') + modern.appendNode('version', project.modernmetals_version.toString()) + modern.appendNode('optional', 'true') + def oreSpawn = asNode().dependencies[0].appendNode('dependency') + oreSpawn.appendNode('groupId', 'zone.moddev.mc.orespawn') + oreSpawn.appendNode('artifactId', 'OreSpawn') + oreSpawn.appendNode('version', project.orespawn_version) } } } @@ -174,18 +183,28 @@ publishing { } } } -tasks.register('verify113MavenCoordinates') { +tasks.register('verify114MavenCoordinates') { dependsOn 'generatePomFileForMavenJavaPublication' doLast { def pom = new XmlSlurper(false, false).parse(layout.buildDirectory.file('publications/mavenJava/pom-default.xml').get().asFile) if ([pom.groupId.text(), pom.artifactId.text(), pom.version.text()] != [expectedGroup, archiveName, project.version.toString()]) { throw new GradleException('Wrong Maven publication coordinates') } + ['BaseMetals': ['zone.moddev.mc.basemetals', project.basemetals_version.toString()], + 'ModernMetals': ['zone.moddev.mc.modernmetals', project.modernmetals_version.toString()]].each { name, required -> + if (!pom.dependencies.dependency.any { it.groupId.text() == required[0] && it.artifactId.text() == name + && it.version.text() == required[1] && it.optional.text() == 'true' }) + throw new GradleException('Maven metadata must pin the optional released ' + name + ' dependency') + } + if (!pom.dependencies.dependency.any { it.artifactId.text() == 'OreSpawn' && it.version.text() == project.orespawn_version } + || !pom.dependencies.dependency.any { it.artifactId.text() == 'BaseMetals' && it.version.text() == '3.0.2.114041' && it.optional.text() == 'true' }) { + throw new GradleException('Wrong published dependency versions') + } } } tasks.withType(PublishToMavenRepository).configureEach { - dependsOn 'verify113MavenCoordinates' - dependsOn preparedDirectory.isPresent() ? 'verify113PreparedReleaseArtifacts' : 'verify113ReleaseArtifacts' + dependsOn 'verify114MavenCoordinates' + dependsOn preparedDirectory.isPresent() ? 'verify114PreparedReleaseArtifacts' : 'verify114ReleaseArtifacts' doFirst { def url = providers.environmentVariable('MAVEN_UPLOAD_URL').getOrElse('') if (!url.startsWith('https://') || url.startsWith('https://invalid.invalid') @@ -195,3 +214,5 @@ tasks.withType(PublishToMavenRepository).configureEach { } } } + +tasks.named('check') { dependsOn 'verify114MavenCoordinates' } diff --git a/gradle/release/artifacts.gradle b/gradle/release/artifacts.gradle index e853298..578c1b1 100644 --- a/gradle/release/artifacts.gradle +++ b/gradle/release/artifacts.gradle @@ -19,7 +19,7 @@ tasks.register('verifyJava8Toolchain') { description = 'Checks Java 8 compatibility; exact compiler versions are required only for release builds.' doLast { def compiler = javaToolchains.compilerFor { languageVersion = JavaLanguageVersion.of(8) }.get().metadata - if (compiler.languageVersion.asInt() != 8) throw new GradleException('Minecraft 1.13 requires Java 8.') + if (compiler.languageVersion.asInt() != 8) throw new GradleException('Minecraft 1.14 requires Java 8.') if (providers.gradleProperty('releaseBuild').getOrElse('false').toBoolean() && (compiler.javaRuntimeVersion != '1.8.0_502-b07' || System.getProperty('java.runtime.version') != '17.0.1+12')) { @@ -38,10 +38,10 @@ tasks.register('verifyReleaseConfiguration') { group = 'verification' dependsOn tasks.named('verifyJava8Toolchain') doLast { - if (project.group != 'zone.moddev.mc.basegems' || project.version != '2.5.0.113021' - || project.minecraft_version != '1.13.2' || project.forge_version != '25.0.223' - || project.mappings_channel != 'snapshot' || project.mappings_version != '20180921-1.13' - || project.orespawn_version != '4.1.7.113021') { + if (project.group != 'zone.moddev.mc.basegems' || project.version != '2.5.0.114041' + || project.minecraft_version != '1.14.4' || project.forge_version != '28.2.26' + || project.mappings_channel != 'snapshot' || project.mappings_version != '20190719-1.14.3' + || project.orespawn_version != '4.1.7.114041') { throw new GradleException('Base Gems target, mappings or dependency pin changed.') } } @@ -105,7 +105,7 @@ def auditJars = { File directory -> } def info = zip.getInputStream(zip.getEntry('META-INF/mods.toml')).getText('UTF-8') if (!info.contains('modId="basegems"') || !info.contains('version="' + project.version + '"') - || !info.contains('versionRange="[1.13.2]"')) { + || !info.contains('versionRange="[1.14.4]"')) { throw new GradleException('Incorrect processed mods.toml.') } if (zip.getEntry('zone/moddev/mc/basegems/BaseGems.class') == null) { diff --git a/gradle/resources.gradle b/gradle/resources.gradle index e058e93..9bc0cfd 100644 --- a/gradle/resources.gradle +++ b/gradle/resources.gradle @@ -1,7 +1,15 @@ def generated = layout.buildDirectory.dir('generated/basegems-resources') +// Eclipse can have a different PATH from a terminal. Keep machine-specific +// interpreter paths out of the shared build and honour the usual -P override. +def localBuild = new Properties() +def localBuildFile = rootProject.file('local-build.properties') +if (localBuildFile.isFile()) localBuildFile.withInputStream { localBuild.load(it) } + def generator = tasks.register('generateGemResources', Exec) { def python = providers.gradleProperty('pythonExecutable') + .orElse(providers.provider { localBuild.getProperty('pythonExecutable')?.trim() ?: null }) .orElse(org.gradle.internal.os.OperatingSystem.current().isWindows() ? 'python' : 'python3') + inputs.property 'pythonExecutable', python inputs.file 'gradle/generate-resources.py' inputs.file 'gradle/model-templates.json' inputs.dir 'src/main/resources/assets/basegems' diff --git a/gradle/verification-114.gradle b/gradle/verification-114.gradle new file mode 100644 index 0000000..58bfb1a --- /dev/null +++ b/gradle/verification-114.gradle @@ -0,0 +1,90 @@ +// Explicit native probes stay separate from player code and ordinary launches. +sourceSets { + integrationTest { + compileClasspath += sourceSets.main.output + sourceSets.main.compileClasspath + runtimeClasspath += sourceSets.main.output + sourceSets.main.runtimeClasspath + } + clientIntegrationTest { + compileClasspath += sourceSets.main.output + sourceSets.main.compileClasspath + runtimeClasspath += sourceSets.main.output + sourceSets.main.runtimeClasspath + } +} +configurations { + integrationTestImplementation.extendsFrom implementation + integrationTestRuntimeOnly.extendsFrom runtimeOnly + clientIntegrationTestImplementation.extendsFrom implementation + clientIntegrationTestRuntimeOnly.extendsFrom runtimeOnly +} +['integrationTest', 'clientIntegrationTest'].each { setName -> + tasks.register('prepare' + setName.capitalize() + 'Mod', Sync) { + dependsOn setName + 'Classes' + from sourceSets[setName].output + into layout.buildDirectory.dir('forge-run-mod-classes/' + setName) + } +} +minecraft.runs { + register('probeServer') { + workingDir.set(layout.projectDirectory.dir(providers.gradleProperty('probeDirectory').orElse('run/verification/server-high').get())) + mods { basegemsprobe { source sourceSets.integrationTest } } + def mainPath = baseGemsBuild.developmentOutput.get().asFile.absolutePath + def probePath = layout.buildDirectory.dir('forge-run-mod-classes/integrationTest').get().asFile.absolutePath + environment 'MOD_CLASSES', "basegems%%${mainPath}${File.pathSeparator}basegems%%${mainPath}${File.pathSeparator}basegemsprobe%%${probePath}${File.pathSeparator}basegemsprobe%%${probePath}" + args '--nogui' + if (providers.gradleProperty('probeUpgrade').orElse('false').get().toBoolean()) args '--forceUpgrade' + } + register('probeClient') { + workingDir.set(layout.projectDirectory.dir(providers.gradleProperty('probeDirectory').orElse('run/verification/client').get())) + environment 'target', 'fmluserdevclient' + mods { basegemsclientprobe { source sourceSets.clientIntegrationTest } } + def mainPath = baseGemsBuild.developmentOutput.get().asFile.absolutePath + def probePath = layout.buildDirectory.dir('forge-run-mod-classes/clientIntegrationTest').get().asFile.absolutePath + environment 'MOD_CLASSES', "basegems%%${mainPath}${File.pathSeparator}basegems%%${mainPath}${File.pathSeparator}basegemsclientprobe%%${probePath}${File.pathSeparator}basegemsclientprobe%%${probePath}" + } +} +tasks.withType(JavaExec).configureEach { + if (name in ['runProbeServer', 'runProbeClient']) { + dependsOn 'prepareDevelopmentMod', name == 'runProbeServer' ? 'prepareIntegrationTestMod' : 'prepareClientIntegrationTestMod' + javaLauncher = javaToolchains.launcherFor { languageVersion = JavaLanguageVersion.of(8) } + systemProperty 'basegemsprobe.upgrade', providers.gradleProperty('probeUpgrade').orElse('false').get() + doFirst { + File directory = file(providers.gradleProperty('probeDirectory').orElse(name == 'runProbeServer' + ? 'run/verification/server-high' : 'run/verification/client').get()).canonicalFile + if (!directory.toPath().startsWith(file('run/verification').canonicalFile.toPath()) + && !directory.toPath().startsWith(layout.buildDirectory.get().asFile.canonicalFile.toPath())) { + throw new GradleException('Probe runs require a disposable directory under run/verification or build') + } + directory.mkdirs() + new File(directory, 'mods').mkdirs() + if (name == 'runProbeServer') { + if (!new File(directory, 'eula.txt').exists()) new File(directory, 'eula.txt').text = 'eula=true\n' + if (!new File(directory, 'server.properties').exists()) new File(directory, 'server.properties').text = + 'online-mode=false\nserver-ip=127.0.0.1\nserver-port=0\nview-distance=2\nmax-tick-time=0\nlevel-seed=16112026\n' + } + } + doLast { + File receipt = new File(workingDir, name == 'runProbeServer' ? 'server-probe.json' : 'client-probe.json') + if (!receipt.isFile() || new groovy.json.JsonSlurper().parse(receipt).status != 'passed') { + throw new GradleException("Native test failed: ${receipt}") + } + } + } +} +tasks.named('check') { dependsOn 'integrationTestClasses', 'clientIntegrationTestClasses' } +tasks.register('verifyPortResources', Exec) { + group = 'verification' + dependsOn 'generateGemResources' + commandLine 'node', '--test', 'tools/test_port_114.js' +} +tasks.named('check') { dependsOn 'verifyPortResources' } + +def probeJar = tasks.register('packagedProbeDeobfJar', Jar) { + dependsOn 'integrationTestClasses' + from sourceSets.integrationTest.output + archiveFileName = 'basegemsprobe-deobf.jar' + destinationDirectory = layout.buildDirectory.dir('packaged-probes') +} +def packagedProbe = renamer.classes(probeJar) { + map.from minecraft.dependency.toSrgFile + output = layout.buildDirectory.file('packaged-probes/basegemsprobe.jar') +} +tasks.register('preparePackagedProbe') { dependsOn packagedProbe, 'assemble' } diff --git a/src/clientIntegrationTest/java/zone/moddev/mc/basegems/testmod/BaseGemsClientProbe.java b/src/clientIntegrationTest/java/zone/moddev/mc/basegems/testmod/BaseGemsClientProbe.java new file mode 100644 index 0000000..2afdec8 --- /dev/null +++ b/src/clientIntegrationTest/java/zone/moddev/mc/basegems/testmod/BaseGemsClientProbe.java @@ -0,0 +1,166 @@ +package zone.moddev.mc.basegems.testmod; +import java.util.*; +import net.minecraft.block.Block; +import java.nio.file.*; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.screen.*; +import net.minecraft.client.gui.widget.button.Button; +import net.minecraft.client.renderer.model.*; +import net.minecraft.item.ItemStack; +import net.minecraft.util.*; +import net.minecraft.world.*; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.event.TickEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.fml.*; +import net.minecraftforge.fml.common.Mod; +import zone.moddev.mc.basegems.client.GemConfigScreen; +import zone.moddev.mc.basegems.config.*; +import zone.moddev.mc.basegems.content.*; +import zone.moddev.mc.orespawn.api.client.WorldSettingsExtensionRegistry; + +/** Explicit automated client gate; excluded from production and manual profiles. */ +@Mod("basegemsclientprobe") +@Mod.EventBusSubscriber(modid="basegemsclientprobe",value=Dist.CLIENT) +public final class BaseGemsClientProbe { + private static int state,ticks,loaded; + private static net.minecraft.server.MinecraftServer stopping; + private static void require(boolean value,String message){if(!value)throw new IllegalStateException(message);} + @SubscribeEvent public static void tick(TickEvent.ClientTickEvent event){ + if(event.phase!=TickEvent.Phase.END||state==5)return; + Minecraft mc=Minecraft.getInstance(); + try{ + if(ticks%200==0)System.out.println("BASEGEMS_CLIENT_STAGE "+state+" screen="+(mc.currentScreen==null?"null":mc.currentScreen.getClass().getName())); + if(mc.currentScreen instanceof net.minecraftforge.fml.client.gui.LoadingErrorScreen){ + StringBuilder details=new StringBuilder(); + for(java.lang.reflect.Field f:mc.currentScreen.getClass().getDeclaredFields())if(java.util.List.class.isAssignableFrom(f.getType())){ + f.setAccessible(true);for(Object message:(java.util.List)f.get(mc.currentScreen)){ + if(message instanceof net.minecraftforge.fml.ModLoadingWarning)details.append(((net.minecraftforge.fml.ModLoadingWarning)message).formatToString()); + else details.append(message); + } + } + throw new IllegalStateException("Forge loading screen: "+details); + } + if(++ticks>3600)throw new IllegalStateException("Client gate timeout in stage "+state); + if(state==0&&mc.currentScreen instanceof MainMenuScreen){ + validate(mc); + mc.launchIntegratedServer("basegems-smoke","Base Gems 1.14 smoke",new WorldSettings(14162026L,GameType.CREATIVE,false,false,WorldType.DEFAULT));state=1;ticks=0; + }else if(state==1&&mc.world!=null&&mc.player!=null&&++loaded>80){ + stopping=mc.getIntegratedServer();mc.world.sendQuittingDisconnectingPacket();mc.loadWorld(null);mc.displayGuiScreen(new MainMenuScreen());state=2;ticks=0;loaded=0; + }else if(state==2&&mc.currentScreen instanceof MainMenuScreen&&!stopping.getExecutionThread().isAlive()){ + mc.launchIntegratedServer("basegems-smoke","Base Gems 1.14 smoke",null);state=3;ticks=0; + }else if(state==3&&mc.world!=null&&mc.player!=null&&++loaded>80){ + stopping=mc.getIntegratedServer();mc.world.sendQuittingDisconnectingPacket();mc.loadWorld(null);mc.displayGuiScreen(new MainMenuScreen());state=4;ticks=0; + }else if(state==4&&!stopping.getExecutionThread().isAlive()){ + Files.write(Paths.get("client-probe.json"),("{\"status\":\"passed\",\"items\":"+ModContent.items().size()+",\"ores\":33,\"worldReopened\":true}").getBytes(java.nio.charset.StandardCharsets.UTF_8));state=5;mc.shutdown(); + } + }catch(Throwable e){ + e.printStackTrace();try{Files.write(Paths.get("client-probe.json"),("{\"status\":\"failed\",\"failure\":\""+e.toString().replace("\"","'")+"\"}").getBytes(java.nio.charset.StandardCharsets.UTF_8));}catch(Exception ignored){}state=5;mc.shutdown(); + } + } + private static void validate(Minecraft mc){ + Screen parent=mc.currentScreen; + Screen config=ModList.get().getModContainerById("basegems").get().getCustomExtension(ExtensionPoint.CONFIGGUIFACTORY).get().apply(mc,parent); + require(config instanceof GemConfigScreen,"Mods-list config factory"); + String original=GemConfig.configuredMode(); + mc.displayGuiScreen(config);List