From 1c050eb7be19c13226523775167682d93b01ae70 Mon Sep 17 00:00:00 2001 From: JohnBraham Date: Tue, 24 Nov 2026 18:07:02 +0000 Subject: [PATCH] Bring Base Gems to Minecraft 1.15.2 --- .github/workflows/ci.yml | 14 +- .github/workflows/deploy-release.yml | 32 +- .github/workflows/release-on-tag.yml | 6 +- .gitignore | 2 + CHANGELOG.txt | 16 + README.md | 31 +- build.gradle | 10 +- docs/BUILDING.md | 31 +- docs/MANUAL_TESTING.md | 21 +- docs/MIGRATION.md | 12 +- docs/PORTING_115.md | 45 + docs/RELEASING.md | 14 +- gradle.properties | 19 +- ...ty-114.gradle => compatibility-115.gradle} | 28 +- gradle/dependencies.json | 12 +- gradle/generate-resources.py | 2 +- gradle/local-companions-115.gradle | 63 + gradle/model-templates.json | 1048 ++++++----------- ...{release-114.gradle => release-115.gradle} | 30 +- gradle/release/artifacts.gradle | 12 +- ...ion-114.gradle => verification-115.gradle} | 2 +- .../basegems/testmod/BaseGemsClientProbe.java | 56 +- .../resources/META-INF/mods.toml | 2 +- .../mc/basegems/testmod/BaseGemsProbe.java | 6 +- .../resources/META-INF/mods.toml | 2 +- .../mc/basegems/client/ClientSetup.java | 35 +- .../client/MaterialProjectileRenderer.java | 2 +- .../mc/basegems/content/CrackhammerItem.java | 2 +- .../moddev/mc/basegems/content/GemBlocks.java | 6 +- .../mc/basegems/content/GemOreBlock.java | 2 - .../mc/basegems/content/MaterialItems.java | 2 +- .../mc/basegems/content/MoltenFluid.java | 7 +- src/main/resources/META-INF/mods.toml | 8 +- src/main/resources/pack.mcmeta | 2 +- tools/test_bar_models.js | 29 + tools/{test_port_114.js => test_port_115.js} | 0 36 files changed, 726 insertions(+), 885 deletions(-) create mode 100644 docs/PORTING_115.md rename gradle/{compatibility-114.gradle => compatibility-115.gradle} (87%) create mode 100644 gradle/local-companions-115.gradle rename gradle/{release-114.gradle => release-115.gradle} (92%) rename gradle/{verification-114.gradle => verification-115.gradle} (98%) create mode 100644 tools/test_bar_models.js rename tools/{test_port_114.js => test_port_115.js} (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e94332..8fad27a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,16 +1,16 @@ -name: Base Gems 1.14.4 CI +name: Base Gems 1.15.2 CI on: push: - branches: [master-1.14.4, 'feature/**'] + branches: [master-1.15.2, 'feature/**'] pull_request: - branches: [master-1.14.4] + branches: [master-1.15.2] permissions: contents: read concurrency: - group: basegems-114-${{ github.workflow }}-${{ github.ref }} + group: basegems-115-${{ 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 verify114ReleaseArtifacts write114ReleaseChecksums prepareEclipse \ + bash ./gradlew clean check build javadoc verify115ReleaseArtifacts write115ReleaseChecksums 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.14.4-${{ github.sha }} + name: BaseGems-1.15.2-${{ 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.14.4-diagnostics-${{ github.sha }} + name: BaseGems-1.15.2-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 d9762b4..55fe968 100644 --- a/.github/workflows/deploy-release.yml +++ b/.github/workflows/deploy-release.yml @@ -1,15 +1,15 @@ -name: Release Base Gems 1.14.4 +name: Release Base Gems 1.15.2 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.14.4 + description: Four-part version for Minecraft 1.15.2 required: true type: string release_commit: - description: Full SHA of the checked MMD master-1.14.4 commit + description: Full SHA of the checked MMD master-1.15.2 commit required: true type: string tested_jar_sha256: @@ -33,13 +33,13 @@ permissions: contents: read concurrency: - group: basegems-release-114 + group: basegems-release-115 cancel-in-progress: false jobs: qualify: name: Verify merged CI candidate - if: github.repository == 'MinecraftModDevelopmentMods/BaseGems' && github.ref == 'refs/heads/master-1.14.4' + if: github.repository == 'MinecraftModDevelopmentMods/BaseGems' && github.ref == 'refs/heads/master-1.15.2' 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]+\.114041$ ]] + [[ "$RELEASE_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+\.115021$ ]] [[ "$RELEASE_SHA" =~ ^[[:xdigit:]]{40}$ ]] [[ "$TESTED_SHA" =~ ^[[:xdigit:]]{64}$ ]] test "$(git rev-parse HEAD)" = "$RELEASE_SHA" - test "$(gh api "repos/$GITHUB_REPOSITORY/branches/master-1.14.4" --jq .commit.sha)" = "$RELEASE_SHA" + test "$(gh api "repos/$GITHUB_REPOSITORY/branches/master-1.15.2" --jq .commit.sha)" = "$RELEASE_SHA" grep -Fxq "mod_version=$RELEASE_VERSION" gradle.properties - grep -Fxq 'minecraft_version=1.14.4' gradle.properties + grep -Fxq 'minecraft_version=1.15.2' gradle.properties ci_run="$(gh api --method GET "repos/$GITHUB_REPOSITORY/actions/workflows/ci.yml/runs" \ - -f branch=master-1.14.4 -f head_sha="$RELEASE_SHA" -f event=push -f status=success \ + -f branch=master-1.15.2 -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.14.4-${{ inputs.release_commit }} + name: BaseGems-1.15.2-${{ 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.14.4-${{ inputs.release_commit }} + name: BaseGems-1.15.2-${{ 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.14.4-${{ inputs.release_commit }} + name: BaseGems-1.15.2-${{ inputs.release_commit }} run-id: ${{ needs.qualify.outputs.ci_run }} github-token: ${{ github.token }} path: ${{ runner.temp }}/release-input @@ -192,12 +192,12 @@ jobs: with: curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} curseforge-id: '1793939' - name: Base Gems ${{ inputs.release_version }} for Minecraft 1.14.4 (Forge) + name: Base Gems ${{ inputs.release_version }} for Minecraft 1.15.2 (Forge) version: ${{ inputs.release_version }} version-type: ${{ inputs.curseforge_release_level }} changelog-file: ${{ runner.temp }}/release-input/CHANGELOG.txt loaders: forge - game-versions: '1.14.4' + game-versions: '1.15.2' game-version-filter: none environment: client | server java: Java 8 @@ -233,7 +233,7 @@ jobs: steps: - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 with: - name: BaseGems-1.14.4-${{ inputs.release_commit }} + name: BaseGems-1.15.2-${{ inputs.release_commit }} run-id: ${{ needs.qualify.outputs.ci_run }} github-token: ${{ github.token }} path: ${{ runner.temp }}/release-input @@ -246,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.14.4 (Forge)" \ + --title "Base Gems $RELEASE_VERSION for Minecraft 1.15.2 (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 58b0cbf..8b4fcba 100644 --- a/.github/workflows/release-on-tag.yml +++ b/.github/workflows/release-on-tag.yml @@ -1,7 +1,7 @@ -name: Validate Base Gems 1.14.4 tag +name: Validate Base Gems 1.15.2 tag on: push: - tags: ['*.*.*.114041'] + tags: ['*.*.*.115021'] 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.14.4' gradle.properties + grep -Fxq 'minecraft_version=1.15.2' gradle.properties echo 'Tag validated. Publication uses deploy-release.yml with explicit confirmation.' >> "$GITHUB_STEP_SUMMARY" diff --git a/.gitignore b/.gitignore index 78b68bc..343909a 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,5 @@ secret.json /release-candidates/ __pycache__/ *.pyc +/local-basemetals.json +/local-modernmetals.json diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 7d8c4e3..4a9320e 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,19 @@ +2.5.0.115021 for Minecraft 1.15.2 + +Doors, trapdoors and bars no longer hide the terrain behind their gaps. Their +placement and collision behaviour stay the same. + +All 33 gems move across from the 1.14.4 release, with the same names, config +keys, recipes and deposit distribution. Use OreSpawn 4.1.7.115021 and Java 8; +Base Metals 3.0.3.115021 and Modern Metals 3.0.0.115021 are optional. +Bars connect like vanilla iron bars. + +- Ore overlays keep the wider spacing and explicit texture coordinates. +- Gem ores, decorative blocks, molten gems and projectiles use native 1.15 rendering. +- Mining XP, Fortune, Silk Touch, smith trades and recipe discovery carry over. +- Both config screens and the High/Low Fantasy settings remain available. +- Saved gem blocks and items keep their IDs when upgrading a copy of a 1.14 world. + 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 diff --git a/README.md b/README.md index a342787..c8e7b1d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Base Gems for Minecraft 1.14.4 +# Base Gems for Minecraft 1.15.2 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,27 +7,25 @@ pieces, tools, weapons and shields. ## Installation -Use Java 8 and Forge **28.2.26 for Minecraft 1.14.4** on both client and +Use Java 8 and Forge **31.2.57 for Minecraft 1.15.2** on both client and server. Base Gems needs MMD OreSpawn and runs without MMDLib. -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 +Use [MMD OreSpawn 4.1.7.115021](https://github.com/MinecraftModDevelopmentMods/OreSpawn/releases/tag/4.1.7.115021) +or a later compatible 1.15.2 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.2.114041](https://github.com/MinecraftModDevelopmentMods/BaseMetals/releases/tag/3.0.2.114041) -or a later compatible 1.14.4 release. If your old +[Base Metals 3.0.3.115021](https://github.com/MinecraftModDevelopmentMods/BaseMetals/releases/tag/3.0.3.115021) +or a later compatible 1.15.2 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 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. +Metals installed its tools and crushers can use the same recipes. [Modern Metals 3.0.0.115021](https://github.com/MinecraftModDevelopmentMods/ModernMetals/releases/tag/3.0.0.115021) +also supplies shared crushing when installed. ## Upgrading a world -Make a separate copy before opening a 1.13.2 world in 1.14.4. Keep the +Make a separate copy before opening a 1.14.4 world in 1.15.2. 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) @@ -36,9 +34,8 @@ from 1.10–1.12 should first go through the released Base Gems 1.13.2 upgrade. Use a tool strong enough for the gem. Agate and jade need stone level; jasper, ruby and sapphire need iron level; black diamond needs diamond level. -Modern Metals' galvanized steel, stainless steel and titanium hammers are -iron level. A weaker tool breaks the ore -without a drop. These are the same mining requirements as in 1.12. +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. Armourers, toolsmiths and weaponsmiths buy and sell gems for emeralds, @@ -66,7 +63,7 @@ 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 +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. @@ -89,9 +86,9 @@ upgrade recipes are not part of this port. ## Development and credits -The 1.14.4 branch uses ForgeGradle 7 and builds a Java 8 mod. +The 1.15.2 branch uses ForgeGradle 7 and builds a Java 8 mod. See [building and Eclipse setup](docs/BUILDING.md) and the -[manual testing](docs/MANUAL_TESTING.md), [porting notes](docs/PORTING_114.md) +[manual testing](docs/MANUAL_TESTING.md), [porting notes](docs/PORTING_115.md) and the [changelog](CHANGELOG.txt). The gem artwork comes from the 1.12.2 branch. Thanks to Aedda, Eejit, diff --git a/build.gradle b/build.gradle index 9e03877..839e9ad 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+\.114041/)) { - throw new GradleException('Use Major.Minor.Patch.114041 for Minecraft 1.14.4 on Forge.') +if (!(project.version ==~ /\d+\.\d+\.\d+\.115021/)) { + throw new GradleException('Use Major.Minor.Patch.115021 for Minecraft 1.15.2 on Forge.') } // Gradle and Mavenizer use modern JDKs; the mod and game still use Java 8. @@ -190,9 +190,9 @@ tasks.register('verifyFluidRegistration', Exec) { } tasks.named('check') { dependsOn 'verifyFluidRegistration' } -apply from: 'gradle/release-114.gradle' +apply from: 'gradle/release-115.gradle' apply from: 'gradle/normalize-javadoc-trees.gradle' -apply from: 'gradle/verification-114.gradle' -apply from: 'gradle/compatibility-114.gradle' +apply from: 'gradle/verification-115.gradle' +apply from: 'gradle/compatibility-115.gradle' diff --git a/docs/BUILDING.md b/docs/BUILDING.md index 3dd1e49..f36f5d9 100644 --- a/docs/BUILDING.md +++ b/docs/BUILDING.md @@ -1,9 +1,9 @@ -# Building Base Gems for Minecraft 1.14.4 +# Building Base Gems for Minecraft 1.15.2 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, Base Metals and Modern Metals jars, checks their SHA-256 +stages the pinned OreSpawn and Base 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 @@ -20,40 +20,37 @@ From the inner Git checkout on Windows: ```powershell python gradle/stage-legacy-dependencies.py .gradle/legacy-dependencies -.\gradlew.bat check build verify114ReleaseArtifacts write114ReleaseChecksums prepareEclipse +.\gradlew.bat check build verify115ReleaseArtifacts write115ReleaseChecksums prepareEclipse ``` On Linux or macOS, use `python3` and `./gradlew`. The game jar is -`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 +`build/libs/BaseGems-2.5.0.115021.jar`. The build uses Forge 31.2.57 and +MCP snapshot 20200514-1.15.1. 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 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. +The optional metal integration uses published Base Metals 3.0.3.115021 and Modern Metals 3.0.0.115021. +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 +`prepareEclipse` generates standalone, Base Metals, Modern Metals and combined client profiles. 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: +After building the sibling metal projects, run `pinLocalCompanions`, then +`prepareEclipse` in a separate invocation to test local builds of the companion mods. +Both local player and mapped jars are hash-checked; a stale pin stops refresh. +The selected local Base Metals includes the bars and ore-overlay corrections. +Release mode ignores automatic local pins and rejects an explicit local override. -```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). +See [manual testing](MANUAL_TESTING.md) and [porting notes](PORTING_115.md). diff --git a/docs/MANUAL_TESTING.md b/docs/MANUAL_TESTING.md index a5e8236..9b0c883 100644 --- a/docs/MANUAL_TESTING.md +++ b/docs/MANUAL_TESTING.md @@ -1,17 +1,15 @@ -# Testing Base Gems 1.14.4 +# Testing Base Gems 1.15.2 -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. +Use Java 8, Forge 31.2.57 and OreSpawn 4.1.7.115021. The game jar is +`build/libs/BaseGems-2.5.0.115021.jar`. Base Metals 3.0.3.115021 is optional. -After `prepareEclipse`, choose a normal launch: +Build the siblings, run `pinLocalCompanions`, then run `prepareEclipse` separately. 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. +- `runClientWithBaseMetals.launch`: adds the selected Base Metals candidate. +- `runClientWithModernMetals.launch`: adds the pinned Modern Metals build. +- `runClientWithBaseAndModern.launch`: adds both pinned metal candidates. -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. @@ -19,11 +17,14 @@ 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. +with a gem hammer, then the available Base 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. +Look at several gem ores from shallow angles and in the inventory, including +with your usual resource pack. Their overlays should stay clear of the stone +without flickering or showing pixels from neighbouring textures. 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 diff --git a/docs/MIGRATION.md b/docs/MIGRATION.md index befaf3b..ea5ac19 100644 --- a/docs/MIGRATION.md +++ b/docs/MIGRATION.md @@ -1,15 +1,15 @@ -# Upgrading Base Gems worlds to 1.14.4 +# Upgrading Base Gems worlds to 1.15.2 -Close the game and copy the whole save. Install the 1.14.4 versions of Base +Close the game and copy the whole save. Install the 1.15.2 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 +Open the copy with Java 8 and Forge 31.2.57. Keep the original until you have checked your builds and inventories. 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 +moving on through 1.14 and 1.15, especially if some old chunks remain +unvisited. The 1.15 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. Use Optimize World or the server's `--forceUpgrade` option to convert every diff --git a/docs/PORTING_115.md b/docs/PORTING_115.md new file mode 100644 index 0000000..8cdedbd --- /dev/null +++ b/docs/PORTING_115.md @@ -0,0 +1,45 @@ +# Minecraft 1.15.2 port + +Starts from the published 1.14.4 release, commit `87de48f964d47476a98b1e6af01bfc7657f04212`. +The existing Gradle 9/ForgeGradle 7 build is retained. Forge 31.2.57 matches +the local Base Metals and OreSpawn targets and Forge's recommended MDK; the +official MDK SHA-1 is `42343d3e5d531475276a55c2016572fef87c3355`. Compilation +and Minecraft use Java 8, Gradle Java 17 and Mavenizer Java 25. + +The port keeps all gem names, config keys, recipes, Fantasy modes and ore +distribution. No new flattening is needed after the 1.13 registry conversion. +OreSpawn owns all generation; this mod only supplies its ore provider. Native +1.15 render layers and entity rendering replace 1.14 render hooks. Resource +and data packs use format 5. All 33 ores keep the corrected 0.05 overlay spacing +and explicit face UVs. World-data hooks were checked against mapped 1.15 +classes and the sibling Base Metals hook before testing an upgraded copy. + +Client setup registers render layers through `RenderTypeLookup` and registers +the arrow and bolt renderers by `EntityType`. The shared fluid implementation +uses the mapped `canDisplace` hook, and item/entity positions use native +accessors. The config screens retain the target's matrix-free signatures. +The save-format, chunk-loader and worldgen-protection coremod descriptors +match the mapped 1.15 classes; their existing legacy conversion is retained. + +Published dependencies: OreSpawn 4.1.7.115021 and optional Base Metals 3.0.3.115021. +Their player jars are SHA-256 pinned. No Modern Metals 1.15.2 release is +available, so it is omitted from dependency pins and manual profiles. + +References: [Forge porting guide](https://docs.minecraftforge.net/en/1.15.x/legacy/porting/), +[1.14 to 1.15 primer](https://docs.neoforged.net/primer/docs/1.15/), +[1.15.2 release notes](https://www.minecraft.net/en-us/article/minecraft-java-edition-1-15-2) +and the exact Forge 31 mapped classes. + +Local checks cover all recipe IDs and discovery advancements, Fortune/Silk +Touch/XP, both Fantasy modes, disabled gems, smith trades, furnace accumulation, +ore dimension boundaries, all item models and all 33 ore block/item overlays. +Standalone and Base Metals clients check fluid layers, both projectile renderers, +both config entry points and integrated-world save/reopen. Seven packaged +server boots include a copied 1.14 world upgrade and reopen; the comparison +retains 20,703 gem blocks and 1,128 stacks with their states and item data. +The original fixture remains unchanged. Tests stay outside player jars and +ordinary Eclipse profiles. Manual gameplay and visual acceptance remain next. + +The later stack pass corrects all gem-bar connection templates and tests the +local Modern Metals candidate. Four isolated profiles use local hash pins when +present; public/release dependency resolution remains separate. diff --git a/docs/RELEASING.md b/docs/RELEASING.md index 1f1e2e3..aa57d07 100644 --- a/docs/RELEASING.md +++ b/docs/RELEASING.md @@ -1,16 +1,16 @@ -# Releasing Base Gems for Minecraft 1.14.4 +# Releasing Base Gems for Minecraft 1.15.2 Build with Java 17, Temurin 8u502-b07 for compilation and Java 25 for -Mavenizer. Run check, build, verify114ReleaseArtifacts, -write114ReleaseChecksums, genEclipseRuns and eclipse. Keep the packaged +Mavenizer. Run check, build, verify115ReleaseArtifacts, +write115ReleaseChecksums, 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.14.4`. After merging, wait for the -successful push CI run and download BaseGems-1.14.4-. Compare +Open a PR from the fork to MMD's `master-1.15.2`. After merging, wait for the +successful push CI run and download BaseGems-1.15.2-. 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.14.4 with the release version, full merged +Run deploy-release.yml on master-1.15.2 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.14.4 release. +and keep the compatibility pin on its public 1.15.2 release. diff --git a/gradle.properties b/gradle.properties index ae88cc7..ebf0d56 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.14.4 -forge_version=28.2.26 +minecraft_version=1.15.2 +forge_version=31.2.57 mappings_channel=snapshot -mappings_version=20190719-1.14.3 +mappings_version=20200514-1.15.1 mod_id=basegems mod_group=zone.moddev.mc.basegems -mod_version=2.5.0.114041 +mod_version=2.5.0.115021 mod_artifact=BaseGems loader_name=forge loader_code=1 @@ -20,9 +20,10 @@ 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.114041 -orespawn_version_range=[4.1.7.114041,5.0.0) -mcp_version=20190829.143755 +orespawn_version=4.1.7.115021 +orespawn_version_range=[4.1.7.115021,5.0.0) +mcp_version=20200515.085601 -basemetals_version=3.0.2.114041 -modernmetals_version=3.0.0.114041 +basemetals_version=3.0.3.115021 + +modernmetals_version=3.0.0.115021 diff --git a/gradle/compatibility-114.gradle b/gradle/compatibility-115.gradle similarity index 87% rename from gradle/compatibility-114.gradle rename to gradle/compatibility-115.gradle index 2e395f3..750c69f 100644 --- a/gradle/compatibility-114.gradle +++ b/gradle/compatibility-115.gradle @@ -6,21 +6,28 @@ import java.nio.file.StandardCopyOption import java.security.MessageDigest import java.util.zip.ZipFile +apply from: 'gradle/local-companions-115.gradle' + +def basePin = localCompanionPins.basemetals +def modernPin = localCompanionPins.modernmetals + def published = new JsonSlurper().parse(file('gradle/dependencies.json')).collectEntries { [(it.id): it] } +def haveModern = modernPin.enabled || published.modernmetals != null configurations { baseMetalsDevelopment { canBeConsumed = false; transitive = false } modernMetalsDevelopment { canBeConsumed = false; transitive = false } } dependencies { - baseMetalsDevelopment renamer.dependency(published.basemetals.coordinate) - modernMetalsDevelopment renamer.dependency(published.modernmetals.coordinate) + baseMetalsDevelopment (basePin.enabled ? files(file(basePin.pin.mappedJar)) : renamer.dependency(published.basemetals.coordinate)) + if (haveModern) modernMetalsDevelopment (modernPin.enabled ? files(file(modernPin.pin.mappedJar)) : 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 profiles = [Standalone: ['', []], WithBaseMetals: ['with-basemetals', ['base']]] +if (haveModern) { + profiles.WithModernMetals = ['with-modernmetals', ['modern']] + profiles.WithBaseAndModern = ['with-both', ['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 @@ -33,11 +40,12 @@ def companion = { File f -> 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() + if (kinds.contains('modern')) result["ModernMetals-${project.modernmetals_version}-mapped.jar".toString()] = configurations.modernMetalsDevelopment.singleFile result } def prepare = tasks.register('prepareCompatibilityMods') { - dependsOn configurations.baseMetalsDevelopment, configurations.modernMetalsDevelopment, 'verifyReleaseDependencies' + dependsOn configurations.baseMetalsDevelopment, 'verifyReleaseDependencies', 'verifyLocalCompanions' + if (haveModern) dependsOn configurations.modernMetalsDevelopment doLast { profiles.each { label, spec -> File mods = file('run/' + spec[0] + '/mods').canonicalFile diff --git a/gradle/dependencies.json b/gradle/dependencies.json index f6a3519..96a4a4a 100644 --- a/gradle/dependencies.json +++ b/gradle/dependencies.json @@ -1,23 +1,23 @@ [ { "id": "orespawn", - "coordinate": "zone.moddev.mc.orespawn:OreSpawn:4.1.7.114041", + "coordinate": "zone.moddev.mc.orespawn:OreSpawn:4.1.7.115021", "repository": "https://maven.moddev.zone/releases", - "sha256": "C6171543240D43CD6273601D537D46A8F8C8A8B5992B258827E2F6F713AB7D44", + "sha256": "5CDF25E6D98560CBEF8366D6D1589B66E99A386859E5D659ACBB2B806FCF8F3D", "runtime": true }, { "id": "basemetals", - "coordinate": "zone.moddev.mc.basemetals:BaseMetals:3.0.2.114041", + "coordinate": "zone.moddev.mc.basemetals:BaseMetals:3.0.3.115021", "repository": "https://maven.moddev.zone/releases", - "sha256": "11C0C4A6FE26B22EE794EA76CD6E0F1C5B65FB03540F9E8E0C52425CFEFB062B", + "sha256": "5C7CF937C10D1F131E2716D6242B1B56EEBE051CF8F1B267AA78E6B9AD6784C1", "runtime": false }, { "id": "modernmetals", - "coordinate": "zone.moddev.mc.modernmetals:ModernMetals:3.0.0.114041", + "coordinate": "zone.moddev.mc.modernmetals:ModernMetals:3.0.0.115021", "repository": "https://maven.moddev.zone/releases", "runtime": false, - "sha256": "22942EBC37BE76D940EA6EFCA53DA6E47085D72EAD95D348DE70D7526389683B" + "sha256": "CE6F05F9561CA9621765DC13FE63B24228ACAE2D33CE9968F8EE8F24F899AD7C" } ] diff --git a/gradle/generate-resources.py b/gradle/generate-resources.py index 3ebe622..8ca48a6 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 28.""" +"""Translate the legacy art and build the data pack for Forge 31.""" from pathlib import Path import json diff --git a/gradle/local-companions-115.gradle b/gradle/local-companions-115.gradle new file mode 100644 index 0000000..abc9ef3 --- /dev/null +++ b/gradle/local-companions-115.gradle @@ -0,0 +1,63 @@ +import groovy.json.JsonOutput +import groovy.json.JsonSlurper +import java.security.MessageDigest + +// Local candidates are selected by hash. Release builds keep published dependencies. +def releaseBuild = providers.gradleProperty('releaseBuild').map { it.toBoolean() }.orElse(false).get() +def definitions = [ + basemetals: [label: 'BaseMetals', version: '3.0.3.115021', checkout: '../../BaseMetals 115/BaseMetals', property: 'baseMetalsCheckout'], + modernmetals: [label: 'ModernMetals', version: '3.0.0.115021', checkout: '../../ModernMetals 115/ModernMetals', property: 'modernMetalsCheckout'] +] +def hash = { File jar -> MessageDigest.getInstance('SHA-256').digest(jar.bytes).encodeHex().toString() } +def pins = [:] +definitions.each { modId, definition -> + File pinFile = file("local-${modId}.json") + String flag = 'useLocal' + definition.label + boolean enabled = providers.gradleProperty(flag).map { it.toBoolean() } + .orElse(pinFile.isFile() && !releaseBuild).get() + if (enabled && releaseBuild) throw new GradleException("Release builds must not use local ${definition.label}") + def pin = enabled && pinFile.isFile() ? new JsonSlurper().parse(pinFile) : [:] + if (enabled && pin.isEmpty()) throw new GradleException("Run pinLocal${definition.label} first") + pins[modId] = [enabled: enabled, pin: pin] + tasks.register('pinLocal' + definition.label) { + group = 'development' + description = "Pins the already-built sibling ${definition.label} jars for local testing." + doLast { + File checkout = file(providers.gradleProperty(definition.property).orElse(definition.checkout).get()).canonicalFile + def next = [version: definition.version] + [player: "build/libs/${definition.label}-${definition.version}.jar", + mapped: "build/libs-dev/${definition.label}-${definition.version}-deobf.jar"].each { kind, path -> + File jar = new File(checkout, path) + if (!jar.isFile()) throw new GradleException("Build ${definition.label} first: ${jar}") + next[kind + 'Jar'] = jar.canonicalPath + next[kind + 'Sha256'] = hash(jar) + } + pinFile.setText(JsonOutput.prettyPrint(JsonOutput.toJson(next)) + '\n', 'UTF-8') + } + } +} +ext.localCompanionPins = pins +tasks.register('pinLocalCompanions') { + group = 'development' + dependsOn 'pinLocalBaseMetals', 'pinLocalModernMetals' +} +tasks.register('verifyLocalCompanions') { + group = 'verification' + doLast { + definitions.each { modId, definition -> + def selected = pins[modId] + if (selected.enabled) { + if (selected.pin.version != definition.version) throw new GradleException("Wrong local ${definition.label} version") + ['player', 'mapped'].each { kind -> + File jar = file(selected.pin[kind + 'Jar']) + if (!jar.isFile() || hash(jar) != selected.pin[kind + 'Sha256']) + throw new GradleException("Local ${definition.label} changed. Rebuild, run pinLocal${definition.label}, then regenerate Eclipse launches: ${jar}") + } + } + } + } +} +tasks.named('check') { dependsOn 'verifyLocalCompanions' } +tasks.withType(JavaExec).configureEach { + if (name in ['runClient', 'runServer']) dependsOn 'verifyLocalCompanions' +} diff --git a/gradle/model-templates.json b/gradle/model-templates.json index 911b90c..38133af 100644 --- a/gradle/model-templates.json +++ b/gradle/model-templates.json @@ -3,20 +3,26 @@ "multipart": [ { "apply": { - "model": "basegems:block/{gem}_bars_post" + "model": "basegems:block/{gem}_bars_post_ends" } }, { "when": { - "north": "true" + "north": "false", + "east": "false", + "south": "false", + "west": "false" }, "apply": { - "model": "basegems:block/{gem}_bars_side" + "model": "basegems:block/{gem}_bars_post" } }, { "when": { - "north": "false" + "north": "true", + "east": "false", + "south": "false", + "west": "false" }, "apply": { "model": "basegems:block/{gem}_bars_cap" @@ -24,54 +30,71 @@ }, { "when": { - "south": "true" + "north": "true" }, "apply": { - "model": "basegems:block/{gem}_bars_side_alt" + "model": "basegems:block/{gem}_bars_side" } }, { "when": { - "south": "false" + "north": "false", + "east": "true", + "south": "false", + "west": "false" }, "apply": { - "model": "basegems:block/{gem}_bars_cap_alt", + "model": "basegems:block/{gem}_bars_cap", "y": 90 } }, { "when": { - "west": "true" + "east": "true" }, "apply": { - "model": "basegems:block/{gem}_bars_side_alt", + "model": "basegems:block/{gem}_bars_side", "y": 90 } }, { "when": { + "north": "false", + "east": "false", + "south": "true", "west": "false" }, "apply": { - "model": "basegems:block/{gem}_bars_cap", - "y": 270 + "model": "basegems:block/{gem}_bars_cap_alt" } }, { "when": { - "east": "true" + "south": "true" }, "apply": { - "model": "basegems:block/{gem}_bars_side", + "model": "basegems:block/{gem}_bars_side_alt" + } + }, + { + "when": { + "north": "false", + "east": "false", + "south": "false", + "west": "true" + }, + "apply": { + "model": "basegems:block/{gem}_bars_cap_alt", "y": 90 } }, { "when": { - "east": "false" + "west": "true" }, "apply": { - "model": "basegems:block/{gem}_bars_cap_alt" + "model": "basegems:block/{gem}_bars_side_alt", + "y": 90 } } ] @@ -800,749 +823,290 @@ } }, "models/block/{gem}_bars_cap.json": { + "parent": "minecraft:block/iron_bars_cap", + "textures": { + "particle": "basegems:blocks/{gem}_block", + "bars": "basegems:blocks/{gem}_block", + "edge": "basegems:blocks/{gem}_block" + } + }, + "models/block/{gem}_bars_cap_alt.json": { + "parent": "minecraft:block/iron_bars_cap_alt", + "textures": { + "particle": "basegems:blocks/{gem}_block", + "bars": "basegems:blocks/{gem}_block", + "edge": "basegems:blocks/{gem}_block" + } + }, + "models/block/{gem}_bars_post.json": { + "parent": "minecraft:block/iron_bars_post", + "textures": { + "particle": "basegems:blocks/{gem}_block", + "bars": "basegems:blocks/{gem}_block", + "edge": "basegems:blocks/{gem}_block" + } + }, + "models/block/{gem}_bars_side.json": { + "parent": "minecraft:block/iron_bars_side", + "textures": { + "particle": "basegems:blocks/{gem}_block", + "bars": "basegems:blocks/{gem}_block", + "edge": "basegems:blocks/{gem}_block" + } + }, + "models/block/{gem}_bars_side_alt.json": { + "parent": "minecraft:block/iron_bars_side_alt", + "textures": { + "particle": "basegems:blocks/{gem}_block", + "bars": "basegems:blocks/{gem}_block", + "edge": "basegems:blocks/{gem}_block" + } + }, + "models/block/{gem}_block.json": { + "parent": "block/cube_all", + "textures": { + "all": "basegems:block/{gem}_block" + } + }, + "models/block/{gem}_button.json": { + "parent": "block/button", + "textures": { + "texture": "basegems:block/{gem}_block" + } + }, + "models/block/{gem}_button_inventory.json": { + "parent": "block/button_inventory", + "textures": { + "texture": "basegems:block/{gem}_block" + } + }, + "models/block/{gem}_button_pressed.json": { + "parent": "block/button_pressed", + "textures": { + "texture": "basegems:block/{gem}_block" + } + }, + "models/block/{gem}_door_bottom.json": { + "parent": "block/door_bottom", + "textures": { + "bottom": "basegems:block/{gem}_door_lower", + "top": "basegems:block/{gem}_door_upper" + } + }, + "models/block/{gem}_door_bottom_rh.json": { + "parent": "block/door_bottom_rh", + "textures": { + "bottom": "basegems:block/{gem}_door_lower", + "top": "basegems:block/{gem}_door_upper" + } + }, + "models/block/{gem}_door_top.json": { + "parent": "block/door_top", + "textures": { + "bottom": "basegems:block/{gem}_door_lower", + "top": "basegems:block/{gem}_door_upper" + } + }, + "models/block/{gem}_door_top_rh.json": { + "parent": "block/door_top_rh", + "textures": { + "bottom": "basegems:block/{gem}_door_lower", + "top": "basegems:block/{gem}_door_upper" + } + }, + "models/block/{gem}_inner_stairs.json": { + "parent": "block/inner_stairs", + "textures": { + "bottom": "basegems:block/{gem}_block", + "top": "basegems:block/{gem}_block", + "side": "basegems:block/{gem}_block" + } + }, + "models/block/{gem}_lever.json": { "ambientocclusion": false, "textures": { - "particle": "basegems:block/{gem}_bars", - "bars": "basegems:block/{gem}_bars", - "edge": "basegems:block/{gem}_bars" + "particle": "basegems:block/{gem}_block", + "base": "basegems:block/{gem}_block", + "lever": "minecraft:block/lever" }, "elements": [ { "from": [ - 8, + 5, 0, - 8 + 4 ], "to": [ - 8, - 16, - 9 + 11, + 3, + 12 ], "faces": { + "down": { + "uv": [ + 5, + 4, + 11, + 12 + ], + "texture": "#base" + }, + "up": { + "uv": [ + 5, + 4, + 11, + 12 + ], + "texture": "#base" + }, + "north": { + "uv": [ + 5, + 0, + 11, + 3 + ], + "texture": "#base" + }, + "south": { + "uv": [ + 5, + 0, + 11, + 3 + ], + "texture": "#base" + }, "west": { "uv": [ - 8, + 4, 0, - 7, - 16 + 12, + 3 ], - "texture": "#bars" + "texture": "#base" }, "east": { "uv": [ - 7, + 4, 0, - 8, - 16 + 12, + 3 ], - "texture": "#bars" + "texture": "#base" } } }, { "from": [ 7, - 0, - 9 + 1, + 7 ], "to": [ 9, - 16, + 11, 9 ], + "rotation": { + "origin": [ + 8, + 1, + 8 + ], + "axis": "x", + "angle": -45 + }, "faces": { - "north": { + "down": { + "uv": [ + 7, + 6, + 9, + 8 + ], + "texture": "#lever" + }, + "up": { "uv": [ + 7, + 6, 9, - 0, + 8 + ], + "texture": "#lever" + }, + "north": { + "uv": [ 7, + 6, + 9, 16 ], - "texture": "#bars" + "texture": "#lever" }, "south": { "uv": [ 7, - 0, + 6, + 9, + 16 + ], + "texture": "#lever" + }, + "west": { + "uv": [ + 7, + 6, + 9, + 16 + ], + "texture": "#lever" + }, + "east": { + "uv": [ + 7, + 6, 9, 16 ], - "texture": "#bars" + "texture": "#lever" } } } ] }, - "models/block/{gem}_bars_cap_alt.json": { + "models/block/{gem}_lever_off.json": { "ambientocclusion": false, "textures": { - "particle": "basegems:block/{gem}_bars", - "bars": "basegems:block/{gem}_bars", - "edge": "basegems:block/{gem}_bars" + "particle": "basegems:block/{gem}_block", + "base": "basegems:block/{gem}_block", + "lever": "minecraft:block/lever" }, "elements": [ { "from": [ - 8, + 5, 0, - 7 + 4 ], "to": [ - 8, - 16, - 8 + 11, + 3, + 12 ], "faces": { - "west": { + "down": { "uv": [ - 8, - 0, - 9, - 16 + 5, + 4, + 11, + 12 ], - "texture": "#bars" + "texture": "#base" }, - "east": { - "uv": [ - 9, - 0, - 8, - 16 - ], - "texture": "#bars" - } - } - }, - { - "from": [ - 7, - 0, - 7 - ], - "to": [ - 9, - 16, - 7 - ], - "faces": { - "north": { - "uv": [ - 7, - 0, - 9, - 16 - ], - "texture": "#bars" - }, - "south": { - "uv": [ - 9, - 0, - 7, - 16 - ], - "texture": "#bars" - } - } - } - ] - }, - "models/block/{gem}_bars_post.json": { - "ambientocclusion": false, - "textures": { - "particle": "basegems:block/{gem}_bars", - "bars": "basegems:block/{gem}_bars" - }, - "elements": [ - { - "from": [ - 8, - 0, - 7 - ], - "to": [ - 8, - 16, - 9 - ], - "faces": { - "west": { - "uv": [ - 7, - 0, - 9, - 16 - ], - "texture": "#bars" - }, - "east": { - "uv": [ - 9, - 0, - 7, - 16 - ], - "texture": "#bars" - } - } - }, - { - "from": [ - 7, - 0, - 8 - ], - "to": [ - 9, - 16, - 8 - ], - "faces": { - "north": { - "uv": [ - 7, - 0, - 9, - 16 - ], - "texture": "#bars" - }, - "south": { - "uv": [ - 9, - 0, - 7, - 16 - ], - "texture": "#bars" - } - } - } - ] - }, - "models/block/{gem}_bars_side.json": { - "ambientocclusion": false, - "textures": { - "particle": "basegems:block/{gem}_bars", - "bars": "basegems:block/{gem}_bars", - "edge": "basegems:block/{gem}_bars" - }, - "elements": [ - { - "from": [ - 8, - 0, - 0 - ], - "to": [ - 8, - 16, - 8 - ], - "faces": { - "west": { - "uv": [ - 16, - 0, - 8, - 16 - ], - "texture": "#bars" - }, - "east": { - "uv": [ - 8, - 0, - 16, - 16 - ], - "texture": "#bars" - } - } - }, - { - "from": [ - 7, - 0, - 0 - ], - "to": [ - 9, - 16, - 7 - ], - "faces": { - "north": { - "uv": [ - 7, - 0, - 9, - 16 - ], - "texture": "#edge", - "cullface": "north" - } - } - }, - { - "from": [ - 7, - 0.001, - 0 - ], - "to": [ - 9, - 0.001, - 7 - ], - "faces": { - "down": { - "uv": [ - 9, - 0, - 7, - 7 - ], - "texture": "#edge" - }, - "up": { - "uv": [ - 7, - 0, - 9, - 7 - ], - "texture": "#edge" - } - } - }, - { - "from": [ - 7, - 15.999, - 0 - ], - "to": [ - 9, - 15.999, - 7 - ], - "faces": { - "down": { - "uv": [ - 9, - 0, - 7, - 7 - ], - "texture": "#edge" - }, - "up": { - "uv": [ - 7, - 0, - 9, - 7 - ], - "texture": "#edge" - } - } - } - ] - }, - "models/block/{gem}_bars_side_alt.json": { - "ambientocclusion": false, - "textures": { - "particle": "basegems:block/{gem}_bars", - "bars": "basegems:block/{gem}_bars", - "edge": "basegems:block/{gem}_bars" - }, - "elements": [ - { - "from": [ - 8, - 0, - 8 - ], - "to": [ - 8, - 16, - 16 - ], - "faces": { - "west": { - "uv": [ - 8, - 0, - 0, - 16 - ], - "texture": "#bars" - }, - "east": { - "uv": [ - 0, - 0, - 8, - 16 - ], - "texture": "#bars" - } - } - }, - { - "from": [ - 7, - 0, - 9 - ], - "to": [ - 9, - 16, - 16 - ], - "faces": { - "south": { - "uv": [ - 7, - 0, - 9, - 16 - ], - "texture": "#edge", - "cullface": "south" - }, - "down": { - "uv": [ - 9, - 9, - 7, - 16 - ], - "texture": "#edge" - }, - "up": { - "uv": [ - 7, - 9, - 9, - 16 - ], - "texture": "#edge" - } - } - }, - { - "from": [ - 7, - 0.001, - 9 - ], - "to": [ - 9, - 0.001, - 16 - ], - "faces": { - "down": { - "uv": [ - 9, - 9, - 7, - 16 - ], - "texture": "#edge" - }, - "up": { - "uv": [ - 7, - 9, - 9, - 16 - ], - "texture": "#edge" - } - } - }, - { - "from": [ - 7, - 15.999, - 9 - ], - "to": [ - 9, - 15.999, - 16 - ], - "faces": { - "down": { - "uv": [ - 9, - 9, - 7, - 16 - ], - "texture": "#edge" - }, - "up": { - "uv": [ - 7, - 9, - 9, - 16 - ], - "texture": "#edge" - } - } - } - ] - }, - "models/block/{gem}_block.json": { - "parent": "block/cube_all", - "textures": { - "all": "basegems:block/{gem}_block" - } - }, - "models/block/{gem}_button.json": { - "parent": "block/button", - "textures": { - "texture": "basegems:block/{gem}_block" - } - }, - "models/block/{gem}_button_inventory.json": { - "parent": "block/button_inventory", - "textures": { - "texture": "basegems:block/{gem}_block" - } - }, - "models/block/{gem}_button_pressed.json": { - "parent": "block/button_pressed", - "textures": { - "texture": "basegems:block/{gem}_block" - } - }, - "models/block/{gem}_door_bottom.json": { - "parent": "block/door_bottom", - "textures": { - "bottom": "basegems:block/{gem}_door_lower", - "top": "basegems:block/{gem}_door_upper" - } - }, - "models/block/{gem}_door_bottom_rh.json": { - "parent": "block/door_bottom_rh", - "textures": { - "bottom": "basegems:block/{gem}_door_lower", - "top": "basegems:block/{gem}_door_upper" - } - }, - "models/block/{gem}_door_top.json": { - "parent": "block/door_top", - "textures": { - "bottom": "basegems:block/{gem}_door_lower", - "top": "basegems:block/{gem}_door_upper" - } - }, - "models/block/{gem}_door_top_rh.json": { - "parent": "block/door_top_rh", - "textures": { - "bottom": "basegems:block/{gem}_door_lower", - "top": "basegems:block/{gem}_door_upper" - } - }, - "models/block/{gem}_inner_stairs.json": { - "parent": "block/inner_stairs", - "textures": { - "bottom": "basegems:block/{gem}_block", - "top": "basegems:block/{gem}_block", - "side": "basegems:block/{gem}_block" - } - }, - "models/block/{gem}_lever.json": { - "ambientocclusion": false, - "textures": { - "particle": "basegems:block/{gem}_block", - "base": "basegems:block/{gem}_block", - "lever": "minecraft:block/lever" - }, - "elements": [ - { - "from": [ - 5, - 0, - 4 - ], - "to": [ - 11, - 3, - 12 - ], - "faces": { - "down": { - "uv": [ - 5, - 4, - 11, - 12 - ], - "texture": "#base" - }, - "up": { - "uv": [ - 5, - 4, - 11, - 12 - ], - "texture": "#base" - }, - "north": { - "uv": [ - 5, - 0, - 11, - 3 - ], - "texture": "#base" - }, - "south": { - "uv": [ - 5, - 0, - 11, - 3 - ], - "texture": "#base" - }, - "west": { - "uv": [ - 4, - 0, - 12, - 3 - ], - "texture": "#base" - }, - "east": { - "uv": [ - 4, - 0, - 12, - 3 - ], - "texture": "#base" - } - } - }, - { - "from": [ - 7, - 1, - 7 - ], - "to": [ - 9, - 11, - 9 - ], - "rotation": { - "origin": [ - 8, - 1, - 8 - ], - "axis": "x", - "angle": -45 - }, - "faces": { - "down": { - "uv": [ - 7, - 6, - 9, - 8 - ], - "texture": "#lever" - }, - "up": { - "uv": [ - 7, - 6, - 9, - 8 - ], - "texture": "#lever" - }, - "north": { - "uv": [ - 7, - 6, - 9, - 16 - ], - "texture": "#lever" - }, - "south": { - "uv": [ - 7, - 6, - 9, - 16 - ], - "texture": "#lever" - }, - "west": { - "uv": [ - 7, - 6, - 9, - 16 - ], - "texture": "#lever" - }, - "east": { - "uv": [ - 7, - 6, - 9, - 16 - ], - "texture": "#lever" - } - } - } - ] - }, - "models/block/{gem}_lever_off.json": { - "ambientocclusion": false, - "textures": { - "particle": "basegems:block/{gem}_block", - "base": "basegems:block/{gem}_block", - "lever": "minecraft:block/lever" - }, - "elements": [ - { - "from": [ - 5, - 0, - 4 - ], - "to": [ - 11, - 3, - 12 - ], - "faces": { - "down": { - "uv": [ - 5, - 4, - 11, - 12 - ], - "texture": "#base" - }, - "up": { + "up": { "uv": [ 5, 4, @@ -1690,32 +1254,62 @@ "faces": { "down": { "texture": "#base", - "uv": [0, 0, 16, 16], + "uv": [ + 0, + 0, + 16, + 16 + ], "cullface": "down" }, "up": { "texture": "#base", - "uv": [0, 0, 16, 16], + "uv": [ + 0, + 0, + 16, + 16 + ], "cullface": "up" }, "north": { "texture": "#base", - "uv": [0, 0, 16, 16], + "uv": [ + 0, + 0, + 16, + 16 + ], "cullface": "north" }, "south": { "texture": "#base", - "uv": [0, 0, 16, 16], + "uv": [ + 0, + 0, + 16, + 16 + ], "cullface": "south" }, "west": { "texture": "#base", - "uv": [0, 0, 16, 16], + "uv": [ + 0, + 0, + 16, + 16 + ], "cullface": "west" }, "east": { "texture": "#base", - "uv": [0, 0, 16, 16], + "uv": [ + 0, + 0, + 16, + 16 + ], "cullface": "east" } } @@ -1734,32 +1328,62 @@ "faces": { "down": { "texture": "#overlay", - "uv": [0, 0, 16, 16], + "uv": [ + 0, + 0, + 16, + 16 + ], "cullface": "down" }, "up": { "texture": "#overlay", - "uv": [0, 0, 16, 16], + "uv": [ + 0, + 0, + 16, + 16 + ], "cullface": "up" }, "north": { "texture": "#overlay", - "uv": [0, 0, 16, 16], + "uv": [ + 0, + 0, + 16, + 16 + ], "cullface": "north" }, "south": { "texture": "#overlay", - "uv": [0, 0, 16, 16], + "uv": [ + 0, + 0, + 16, + 16 + ], "cullface": "south" }, "west": { "texture": "#overlay", - "uv": [0, 0, 16, 16], + "uv": [ + 0, + 0, + 16, + 16 + ], "cullface": "west" }, "east": { "texture": "#overlay", - "uv": [0, 0, 16, 16], + "uv": [ + 0, + 0, + 16, + 16 + ], "cullface": "east" } } @@ -2027,5 +1651,13 @@ ] } } + }, + "models/block/{gem}_bars_post_ends.json": { + "parent": "minecraft:block/iron_bars_post_ends", + "textures": { + "particle": "basegems:blocks/{gem}_block", + "bars": "basegems:blocks/{gem}_block", + "edge": "basegems:blocks/{gem}_block" + } } } diff --git a/gradle/release-114.gradle b/gradle/release-115.gradle similarity index 92% rename from gradle/release-114.gradle rename to gradle/release-115.gradle index bc13147..ed1dcc7 100644 --- a/gradle/release-114.gradle +++ b/gradle/release-115.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.14.4-forge-28.2.26-java-8') + 'Build-Target': 'minecraft-1.15.2-forge-31.2.57-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+\.114041/)) { + if (project.group.toString() != expectedGroup || !(project.version.toString() ==~ /\d+\.\d+\.\d+\.115021/)) { 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.14.4]"') - || !metadata.contains('versionRange="[4.1.7.114041,5.0.0)"')) { + || !metadata.contains('versionRange="[1.15.2]"') + || !metadata.contains('versionRange="[4.1.7.115021,5.0.0)"')) { throw new GradleException('Wrong or unresolved release mod metadata') } } @@ -85,14 +85,14 @@ def audit = { File directory -> } } -tasks.register('verify114ReleaseArtifacts') { +tasks.register('verify115ReleaseArtifacts') { group = 'verification' dependsOn tasks.named('assemble'), tasks.named('check') doLast { audit(layout.buildDirectory.dir('libs').get().asFile) } } -tasks.register('write114ReleaseChecksums') { +tasks.register('write115ReleaseChecksums') { group = 'verification' - dependsOn tasks.named('verify114ReleaseArtifacts') + dependsOn tasks.named('verify115ReleaseArtifacts') doLast { File output = layout.buildDirectory.file('release/SHA256SUMS').get().asFile output.parentFile.mkdirs() @@ -101,7 +101,7 @@ tasks.register('write114ReleaseChecksums') { }.join('\n') + '\n', 'UTF-8') } } -tasks.register('verify114PreparedReleaseArtifacts') { +tasks.register('verify115PreparedReleaseArtifacts') { 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.14.4, using Forge 28 and OreSpawn 4.' + description = 'Base Gems for Minecraft 1.15.2, using Forge 31 and OreSpawn 4.' url = 'https://github.com/MinecraftModDevelopmentMods/BaseGems' licenses { license { @@ -158,7 +158,7 @@ publishing { def dependency = asNode().appendNode('dependencies').appendNode('dependency') dependency.appendNode('groupId', 'zone.moddev.mc.basemetals') dependency.appendNode('artifactId', 'BaseMetals') - dependency.appendNode('version', '3.0.2.114041') + dependency.appendNode('version', project.basemetals_version.toString()) dependency.appendNode('optional', 'true') def modern = dependency.parent().appendNode('dependency') modern.appendNode('groupId', 'zone.moddev.mc.modernmetals') @@ -183,7 +183,7 @@ publishing { } } } -tasks.register('verify114MavenCoordinates') { +tasks.register('verify115MavenCoordinates') { dependsOn 'generatePomFileForMavenJavaPublication' doLast { def pom = new XmlSlurper(false, false).parse(layout.buildDirectory.file('publications/mavenJava/pom-default.xml').get().asFile) @@ -197,14 +197,14 @@ tasks.register('verify114MavenCoordinates') { 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' }) { + || !pom.dependencies.dependency.any { it.artifactId.text() == 'BaseMetals' && it.version.text() == '3.0.3.115021' && it.optional.text() == 'true' }) { throw new GradleException('Wrong published dependency versions') } } } tasks.withType(PublishToMavenRepository).configureEach { - dependsOn 'verify114MavenCoordinates' - dependsOn preparedDirectory.isPresent() ? 'verify114PreparedReleaseArtifacts' : 'verify114ReleaseArtifacts' + dependsOn 'verify115MavenCoordinates' + dependsOn preparedDirectory.isPresent() ? 'verify115PreparedReleaseArtifacts' : 'verify115ReleaseArtifacts' doFirst { def url = providers.environmentVariable('MAVEN_UPLOAD_URL').getOrElse('') if (!url.startsWith('https://') || url.startsWith('https://invalid.invalid') @@ -215,4 +215,4 @@ tasks.withType(PublishToMavenRepository).configureEach { } } -tasks.named('check') { dependsOn 'verify114MavenCoordinates' } +tasks.named('check') { dependsOn 'verify115MavenCoordinates' } diff --git a/gradle/release/artifacts.gradle b/gradle/release/artifacts.gradle index 578c1b1..5d848ad 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.14 requires Java 8.') + if (compiler.languageVersion.asInt() != 8) throw new GradleException('Minecraft 1.15 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.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') { + if (project.group != 'zone.moddev.mc.basegems' || project.version != '2.5.0.115021' + || project.minecraft_version != '1.15.2' || project.forge_version != '31.2.57' + || project.mappings_channel != 'snapshot' || project.mappings_version != '20200514-1.15.1' + || project.orespawn_version != '4.1.7.115021') { 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.14.4]"')) { + || !info.contains('versionRange="[1.15.2]"')) { throw new GradleException('Incorrect processed mods.toml.') } if (zip.getEntry('zone/moddev/mc/basegems/BaseGems.class') == null) { diff --git a/gradle/verification-114.gradle b/gradle/verification-115.gradle similarity index 98% rename from gradle/verification-114.gradle rename to gradle/verification-115.gradle index 58bfb1a..9df5e72 100644 --- a/gradle/verification-114.gradle +++ b/gradle/verification-115.gradle @@ -73,7 +73,7 @@ tasks.named('check') { dependsOn 'integrationTestClasses', 'clientIntegrationTes tasks.register('verifyPortResources', Exec) { group = 'verification' dependsOn 'generateGemResources' - commandLine 'node', '--test', 'tools/test_port_114.js' + commandLine 'node', '--test', 'tools/test_port_115.js', 'tools/test_bar_models.js' } tasks.named('check') { dependsOn 'verifyPortResources' } diff --git a/src/clientIntegrationTest/java/zone/moddev/mc/basegems/testmod/BaseGemsClientProbe.java b/src/clientIntegrationTest/java/zone/moddev/mc/basegems/testmod/BaseGemsClientProbe.java index 2afdec8..a22d41b 100644 --- a/src/clientIntegrationTest/java/zone/moddev/mc/basegems/testmod/BaseGemsClientProbe.java +++ b/src/clientIntegrationTest/java/zone/moddev/mc/basegems/testmod/BaseGemsClientProbe.java @@ -31,7 +31,7 @@ public final class BaseGemsClientProbe { 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){ + if(mc.currentScreen instanceof net.minecraftforge.fml.client.gui.screen.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)){ @@ -44,11 +44,12 @@ public final class BaseGemsClientProbe { 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; + mc.launchIntegratedServer("basegems-smoke","Base Gems 1.15 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){ + validateWorldRendering(mc); 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; + mc.launchIntegratedServer("basegems-smoke","Base Gems 1.15 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()){ @@ -58,6 +59,31 @@ public final class BaseGemsClientProbe { 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 validateWorldRendering(Minecraft mc) { + for (net.minecraft.entity.EntityType type : + Arrays.asList(zone.moddev.mc.basegems.entity.ModEntities.CUSTOM_ARROW.get(), + zone.moddev.mc.basegems.entity.ModEntities.CUSTOM_BOLT.get())) { + zone.moddev.mc.basegems.entity.MaterialProjectile projectile = type.create(mc.world); + require(projectile != null && mc.getRenderManager().getRenderer(projectile) + instanceof zone.moddev.mc.basegems.client.MaterialProjectileRenderer, + "Native projectile renderer " + type.getRegistryName()); + } + ModContent.blocks().forEach((name, block) -> { + if (block instanceof net.minecraft.block.DoorBlock || block instanceof net.minecraft.block.TrapDoorBlock + || block instanceof net.minecraft.block.PaneBlock) { + require(net.minecraft.client.renderer.RenderTypeLookup.canRenderInLayer(block.getDefaultState(), + net.minecraft.client.renderer.RenderType.getCutoutMipped()), "Decorative cutout " + name); + } + }); + for (FluidContent fluid : ModContent.fluids().values()) { + require(net.minecraft.client.renderer.RenderTypeLookup.canRenderInLayer(fluid.source().get().getDefaultState(), + net.minecraft.client.renderer.RenderType.getTranslucent()), "Source fluid render layer"); + require(net.minecraft.client.renderer.RenderTypeLookup.canRenderInLayer(fluid.flowing().get().getDefaultState(), + net.minecraft.client.renderer.RenderType.getTranslucent()), "Flowing fluid render layer"); + require(net.minecraft.client.renderer.RenderTypeLookup.canRenderInLayer(fluid.block().get().getDefaultState(), + net.minecraft.client.renderer.RenderType.getTranslucent()), "Fluid block render layer"); + } + } private static void validate(Minecraft mc){ Screen parent=mc.currentScreen; Screen config=ModList.get().getModContainerById("basegems").get().getCustomExtension(ExtensionPoint.CONFIGGUIFACTORY).get().apply(mc,parent); @@ -74,7 +100,8 @@ private static void validate(Minecraft mc){ int ores=0; for(Map.Entry e:ModContent.blocks().entrySet())if(e.getKey().endsWith("_ore")){ ores++;net.minecraft.block.Block block=e.getValue();String name=e.getKey(); - require(block.getRenderLayer()==BlockRenderLayer.CUTOUT_MIPPED,"Ore cutout "+name); + require(net.minecraft.client.renderer.RenderTypeLookup.canRenderInLayer(block.getDefaultState(), + net.minecraft.client.renderer.RenderType.getCutoutMipped()),"Ore cutout "+name); validateOreModel(mc.getBlockRendererDispatcher().getModelForState(block.getDefaultState()),block,name,"minecraft:block/stone","basegems:blocks/ore_overlays/"+name); validateOreModel(mc.getItemRenderer().getItemModelWithOverrides(new ItemStack(block),null,null),null,name,"minecraft:block/stone","basegems:blocks/ore_overlays/"+name); } @@ -97,18 +124,18 @@ private static void validateOreModel(IBakedModel model, Block block, String name boolean hasBase = false; boolean hasOverlay = false; for (BakedQuad quad : quads) { - String texture = quad.getSprite().getName().toString(); + String texture = quad.func_187508_a().getName().toString(); hasBase |= host.equals(texture); hasOverlay |= overlay.equals(texture); - require(!"missingno".equals(quad.getSprite().getName().getPath()), name + " missing texture"); + require(!"missingno".equals(quad.func_187508_a().getName().getPath()), name + " missing texture"); validateOreVertices(quad, overlay.equals(texture), name); if (overlay.equals(texture)) { boolean transparent = false; boolean visible = false; - for (int y = 0; y < quad.getSprite().getHeight(); y++) { - for (int x = 0; x < quad.getSprite().getWidth(); x++) { - if (quad.getSprite().isPixelTransparent(0, x, y)) transparent = true; + for (int y = 0; y < quad.func_187508_a().getHeight(); y++) { + for (int x = 0; x < quad.func_187508_a().getWidth(); x++) { + if (quad.func_187508_a().isPixelTransparent(0, x, y)) transparent = true; else visible = true; } } @@ -128,14 +155,17 @@ private static void validateOreVertices(BakedQuad quad, boolean overlay, String float high = overlay ? 16.05F / 16 : 1; for (int vertex = 0; vertex < 4; vertex++) { - float u = quad.getSprite().getUnInterpolatedU(Float.intBitsToFloat(vertices[vertex * stride + 4])); - float v = quad.getSprite().getUnInterpolatedV(Float.intBitsToFloat(vertices[vertex * stride + 5])); + net.minecraft.client.renderer.texture.TextureAtlasSprite sprite = quad.func_187508_a(); + float u = (Float.intBitsToFloat(vertices[vertex * stride + 4]) - sprite.getMinU()) + * 16 / (sprite.getMaxU() - sprite.getMinU()); + float v = (Float.intBitsToFloat(vertices[vertex * stride + 5]) - sprite.getMinV()) + * 16 / (sprite.getMaxV() - sprite.getMinV()); require(u >= -0.01F && u <= 16.01F && v >= -0.01F && v <= 16.01F, name + " samples outside its texture sprite"); for (int axis = 0; axis < 3; axis++) { float coordinate = Float.intBitsToFloat(vertices[vertex * stride + axis]); require(Math.min(Math.abs(coordinate - low), Math.abs(coordinate - high)) < 0.000001F, - name + " incorrect " + (overlay ? "overlay" : "base") + " vertex " + coordinate + " sprite=" + quad.getSprite().getName()); + name + " incorrect " + (overlay ? "overlay" : "base") + " vertex " + coordinate + " sprite=" + quad.func_187508_a().getName()); } } } @@ -151,7 +181,7 @@ private static void validateBucketModel(Minecraft minecraft, String name) { require(!quads.isEmpty(), name + " has no rendered quads"); boolean hasTintedFluidLayer = false; for (BakedQuad quad : quads) { - require(!"missingno".equals(quad.getSprite().getName().getPath()), + require(!"missingno".equals(quad.func_187508_a().getName().getPath()), name + " uses the missing-texture sprite"); if (quad.hasTintIndex() && quad.getTintIndex() == 1) hasTintedFluidLayer = true; } diff --git a/src/clientIntegrationTest/resources/META-INF/mods.toml b/src/clientIntegrationTest/resources/META-INF/mods.toml index 721e004..637849f 100644 --- a/src/clientIntegrationTest/resources/META-INF/mods.toml +++ b/src/clientIntegrationTest/resources/META-INF/mods.toml @@ -1,5 +1,5 @@ modLoader="javafml" -loaderVersion="[28,)" +loaderVersion="[31,)" license="LGPL-2.1" [[mods]] modId="basegemsclientprobe" diff --git a/src/integrationTest/java/zone/moddev/mc/basegems/testmod/BaseGemsProbe.java b/src/integrationTest/java/zone/moddev/mc/basegems/testmod/BaseGemsProbe.java index 7886542..502a54a 100644 --- a/src/integrationTest/java/zone/moddev/mc/basegems/testmod/BaseGemsProbe.java +++ b/src/integrationTest/java/zone/moddev/mc/basegems/testmod/BaseGemsProbe.java @@ -187,11 +187,11 @@ private void furnace(ServerWorld world) { private void trades() { for (net.minecraft.entity.merchant.villager.VillagerProfession profession : new net.minecraft.entity.merchant.villager.VillagerProfession[]{net.minecraft.entity.merchant.villager.VillagerProfession.ARMORER, net.minecraft.entity.merchant.villager.VillagerProfession.TOOLSMITH, net.minecraft.entity.merchant.villager.VillagerProfession.WEAPONSMITH}) { int offers = 0; - for (net.minecraft.entity.merchant.villager.VillagerTrades.ITrade[] level : net.minecraft.entity.merchant.villager.VillagerTrades.field_221239_a.get(profession).values()) { + for (net.minecraft.entity.merchant.villager.VillagerTrades.ITrade[] level : net.minecraft.entity.merchant.villager.VillagerTrades.VILLAGER_DEFAULT_TRADES.get(profession).values()) { for (net.minecraft.entity.merchant.villager.VillagerTrades.ITrade factory : level) if (factory.getClass().getName().startsWith("zone.moddev.mc.basegems.")) { MerchantOffer offer = factory.getOffer(null, new Random(1)); if (offer == null) continue; offers++; - ItemStack result = offer.func_222206_f(); require(result.getItem() == Items.EMERALD || GemConfig.allows(result.getItem().getRegistryName().getPath()), "Trade policy"); - require(offer.func_222214_i() == 6 && offer.func_222210_n() > 0, "Restock and XP"); + ItemStack result = offer.getSellingStack(); require(result.getItem() == Items.EMERALD || GemConfig.allows(result.getItem().getRegistryName().getPath()), "Trade policy"); + require(offer.func_222214_i() == 6 && offer.getGivenExp() > 0, "Restock and XP"); } } require(offers > 0, "Smith gem offers"); diff --git a/src/integrationTest/resources/META-INF/mods.toml b/src/integrationTest/resources/META-INF/mods.toml index 39c0797..c13c3a5 100644 --- a/src/integrationTest/resources/META-INF/mods.toml +++ b/src/integrationTest/resources/META-INF/mods.toml @@ -1,5 +1,5 @@ modLoader="javafml" -loaderVersion="[28,)" +loaderVersion="[31,)" license="LGPL-2.1" [[mods]] modId="basegemsprobe" diff --git a/src/main/java/zone/moddev/mc/basegems/client/ClientSetup.java b/src/main/java/zone/moddev/mc/basegems/client/ClientSetup.java index d22eeec..6585f83 100644 --- a/src/main/java/zone/moddev/mc/basegems/client/ClientSetup.java +++ b/src/main/java/zone/moddev/mc/basegems/client/ClientSetup.java @@ -2,13 +2,20 @@ import zone.moddev.mc.basegems.content.FluidContent; import zone.moddev.mc.basegems.content.ModContent; -import zone.moddev.mc.basegems.entity.MaterialProjectile; +import zone.moddev.mc.basegems.entity.ModEntities; +import net.minecraft.block.Block; +import net.minecraft.block.DoorBlock; +import net.minecraft.block.PaneBlock; +import net.minecraft.block.TrapDoorBlock; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.RenderTypeLookup; import net.minecraftforge.client.event.ColorHandlerEvent; -import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.DeferredWorkQueue; import net.minecraftforge.fml.client.registry.RenderingRegistry; import net.minecraftforge.fml.ExtensionPoint; import net.minecraftforge.fml.ModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import zone.moddev.mc.orespawn.api.client.WorldSettingsExtensionRegistry; public final class ClientSetup { @@ -20,8 +27,28 @@ public static void register() { WorldSettingsExtensionRegistry.registerConfigScreen("basegems", GemConfigScreen::new); net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext.get().getModEventBus() .addListener(ClientSetup::registerBucketColours); - RenderingRegistry.registerEntityRenderingHandler(MaterialProjectile.class, - manager -> new MaterialProjectileRenderer(manager)); + net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext.get().getModEventBus() + .addListener(ClientSetup::setupRendering); + } + + private static void setupRendering(FMLClientSetupEvent event) { + RenderingRegistry.registerEntityRenderingHandler(ModEntities.CUSTOM_ARROW.get(), MaterialProjectileRenderer::new); + RenderingRegistry.registerEntityRenderingHandler(ModEntities.CUSTOM_BOLT.get(), MaterialProjectileRenderer::new); + DeferredWorkQueue.runLater(ClientSetup::registerRenderLayers); + } + + private static void registerRenderLayers() { + ModContent.blocks().forEach((name, block) -> { + if (name.endsWith("_ore") || block instanceof DoorBlock + || block instanceof TrapDoorBlock || block instanceof PaneBlock) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutoutMipped()); + } + }); + for (FluidContent fluid : ModContent.fluids().values()) { + RenderTypeLookup.setRenderLayer(fluid.source().get(), RenderType.getTranslucent()); + RenderTypeLookup.setRenderLayer(fluid.flowing().get(), RenderType.getTranslucent()); + RenderTypeLookup.setRenderLayer(fluid.block().get(), RenderType.getTranslucent()); + } } private static void registerBucketColours(ColorHandlerEvent.Item event) { diff --git a/src/main/java/zone/moddev/mc/basegems/client/MaterialProjectileRenderer.java b/src/main/java/zone/moddev/mc/basegems/client/MaterialProjectileRenderer.java index ad87c99..5ac9b48 100644 --- a/src/main/java/zone/moddev/mc/basegems/client/MaterialProjectileRenderer.java +++ b/src/main/java/zone/moddev/mc/basegems/client/MaterialProjectileRenderer.java @@ -15,7 +15,7 @@ public MaterialProjectileRenderer(EntityRendererManager manager) { } @Override - protected ResourceLocation getEntityTexture(MaterialProjectile projectile) { + public ResourceLocation getEntityTexture(MaterialProjectile projectile) { return ARROW_TEXTURE; } } diff --git a/src/main/java/zone/moddev/mc/basegems/content/CrackhammerItem.java b/src/main/java/zone/moddev/mc/basegems/content/CrackhammerItem.java index 040100c..0f2a20a 100644 --- a/src/main/java/zone/moddev/mc/basegems/content/CrackhammerItem.java +++ b/src/main/java/zone/moddev/mc/basegems/content/CrackhammerItem.java @@ -97,7 +97,7 @@ private static void spawnOutputs(World world, ItemEntity source, ItemStack resul ItemStack output = result.copy(); output.setCount(Math.min(output.getMaxStackSize(), remaining)); remaining -= output.getCount(); - ItemEntity crushed = new ItemEntity(world, source.posX, source.posY, source.posZ, output); + ItemEntity crushed = new ItemEntity(world, source.getPosX(), source.getPosY(), source.getPosZ(), output); crushed.setDefaultPickupDelay(); world.addEntity(crushed); } diff --git a/src/main/java/zone/moddev/mc/basegems/content/GemBlocks.java b/src/main/java/zone/moddev/mc/basegems/content/GemBlocks.java index 2afd6b3..522fd8a 100644 --- a/src/main/java/zone/moddev/mc/basegems/content/GemBlocks.java +++ b/src/main/java/zone/moddev/mc/basegems/content/GemBlocks.java @@ -20,9 +20,9 @@ static Map create(Gem gem) { blocks.put(name + "_ore", new GemOreBlock(gem, Block.Properties.create(Material.ROCK) .sound(SoundType.STONE).hardnessAndResistance(3, 5).variableOpacity())); blocks.put(name + "_plate", new PlateBlock(properties(gem).variableOpacity(), harvest)); - blocks.put(name + "_bars", new HarvestPane(properties(gem).variableOpacity(), harvest)); - blocks.put(name + "_door", new HarvestDoor(properties(gem).variableOpacity(), harvest)); - blocks.put(name + "_trapdoor", new HarvestTrapDoor(properties(gem).variableOpacity(), harvest)); + blocks.put(name + "_bars", new HarvestPane(properties(gem).variableOpacity().notSolid(), harvest)); + blocks.put(name + "_door", new HarvestDoor(properties(gem).variableOpacity().notSolid(), harvest)); + blocks.put(name + "_trapdoor", new HarvestTrapDoor(properties(gem).variableOpacity().notSolid(), harvest)); blocks.put(name + "_button", new HarvestButton(properties(gem).doesNotBlockMovement(), harvest)); blocks.put(name + "_lever", new HarvestLever(properties(gem).doesNotBlockMovement(), harvest)); blocks.put(name + "_pressure_plate", new HarvestPressurePlate(properties(gem), harvest)); diff --git a/src/main/java/zone/moddev/mc/basegems/content/GemOreBlock.java b/src/main/java/zone/moddev/mc/basegems/content/GemOreBlock.java index 6c755fc..0d35247 100644 --- a/src/main/java/zone/moddev/mc/basegems/content/GemOreBlock.java +++ b/src/main/java/zone/moddev/mc/basegems/content/GemOreBlock.java @@ -2,7 +2,6 @@ import net.minecraft.block.OreBlock; import net.minecraft.block.BlockState; -import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.IItemProvider; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IWorldReader; @@ -21,7 +20,6 @@ final class GemOreBlock extends OreBlock { @Override public ToolType getHarvestTool(BlockState state) { return ToolType.PICKAXE; } @Override public int getHarvestLevel(BlockState state) { return gem.requiredHarvestLevel(); } - @Override public BlockRenderLayer getRenderLayer() { return BlockRenderLayer.CUTOUT_MIPPED; } @Override diff --git a/src/main/java/zone/moddev/mc/basegems/content/MaterialItems.java b/src/main/java/zone/moddev/mc/basegems/content/MaterialItems.java index 9ee6820..1e3326a 100644 --- a/src/main/java/zone/moddev/mc/basegems/content/MaterialItems.java +++ b/src/main/java/zone/moddev/mc/basegems/content/MaterialItems.java @@ -180,7 +180,7 @@ public void onPlayerStoppedUsing(ItemStack bow, World world, LivingEntity user, if (infiniteShot) projectile.pickupStatus = AbstractArrowEntity.PickupStatus.CREATIVE_ONLY; world.addEntity(projectile); } - world.playSound(null, player.posX, player.posY, player.posZ, + world.playSound(null, player.getPosX(), player.getPosY(), player.getPosZ(), SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 1.0F, 1.0F / (random.nextFloat() * 0.4F + 1.2F) + power * 0.5F); if (!infiniteShot && !player.abilities.isCreativeMode) { diff --git a/src/main/java/zone/moddev/mc/basegems/content/MoltenFluid.java b/src/main/java/zone/moddev/mc/basegems/content/MoltenFluid.java index 1f23b41..059bad0 100644 --- a/src/main/java/zone/moddev/mc/basegems/content/MoltenFluid.java +++ b/src/main/java/zone/moddev/mc/basegems/content/MoltenFluid.java @@ -7,13 +7,10 @@ import net.minecraft.fluid.IFluidState; import net.minecraft.item.Item; import net.minecraft.state.StateContainer; -import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IWorld; import net.minecraft.world.IWorldReader; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.fluids.FluidAttributes; import net.minecraft.util.ResourceLocation; @@ -37,8 +34,6 @@ protected FluidAttributes createAttributes() { @Override public Fluid getStillFluid() { return content().source().get(); } @Override public Item getFilledBucket() { return content().bucket().get(); } - @Override @OnlyIn(Dist.CLIENT) - public BlockRenderLayer getRenderLayer() { return BlockRenderLayer.TRANSLUCENT; } @Override protected boolean canSourcesMultiply() { return false; } @Override protected void beforeReplacingBlock(IWorld world, BlockPos pos, BlockState state) { net.minecraft.block.Block.spawnDrops(state, world.getWorld(), pos); @@ -50,7 +45,7 @@ protected FluidAttributes createAttributes() { @Override public boolean isEquivalentTo(Fluid fluid) { return fluid == content().source().get() || fluid == content().flowing().get(); } - @Override protected boolean func_215665_a(IFluidState state, net.minecraft.world.IBlockReader world, + @Override protected boolean canDisplace(IFluidState state, net.minecraft.world.IBlockReader world, BlockPos pos, Fluid fluid, Direction direction) { return direction == Direction.DOWN && !fluid.isEquivalentTo(this); } diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index f02517c..32cc261 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -1,5 +1,5 @@ modLoader="javafml" -loaderVersion="[28,)" +loaderVersion="[31,)" license="LGPL-2.1" issueTrackerURL="https://github.com/MinecraftModDevelopmentMods/BaseGems/issues" @@ -21,20 +21,20 @@ side="BOTH" [[dependencies.basegems]] modId="basemetals" mandatory=false -versionRange="[3.0.2.114041,4.0.0)" +versionRange="[3.0.3.115021,4.0.0)" ordering="AFTER" side="BOTH" [[dependencies.basegems]] modId="minecraft" mandatory=true -versionRange="[1.14.4]" +versionRange="[1.15.2]" ordering="NONE" side="BOTH" [[dependencies.basegems]] modId="modernmetals" mandatory=false -versionRange="[3.0.0.114041,4.0.0)" +versionRange="[3.0.0.115021,4.0.0)" ordering="AFTER" side="BOTH" diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta index 343110a..ea46e4d 100644 --- a/src/main/resources/pack.mcmeta +++ b/src/main/resources/pack.mcmeta @@ -1,6 +1,6 @@ { "pack": { "description": "Base Gems resources", - "pack_format": 4 + "pack_format": 5 } } diff --git a/tools/test_bar_models.js b/tools/test_bar_models.js new file mode 100644 index 0000000..a026e0a --- /dev/null +++ b/tools/test_bar_models.js @@ -0,0 +1,29 @@ +const {test}=require('node:test'); +const assert=require('node:assert/strict'); +const fs=require('node:fs'),path=require('node:path'); +const templates=JSON.parse(fs.readFileSync(path.join(__dirname,'../gradle/model-templates.json'),'utf8')); +test('bar parts reference an existing texture for every gem',()=>{ + const assets=path.join(__dirname,'../src/main/resources/assets/basegems'); + for(const file of fs.readdirSync(path.join(assets,'blockstates')).filter(n=>n.endsWith('_ore.json'))){ + const gem=file.slice(0,-9); + for(const part of ['post','post_ends','cap','cap_alt','side','side_alt']) + for(const texture of Object.values(templates['models/block/{gem}_bars_'+part+'.json'].textures)){ + const actual=texture.replace('{gem}',gem).replace('basegems:',''); + assert(fs.existsSync(path.join(assets,'textures',actual+'.png')),gem+' '+part+' '+actual); + } + } +}); +test('bars use vanilla post ends, isolated posts and single-connection caps',()=>{ + const json=templates['blockstates/{gem}_bars.json']; + for(let mask=0;mask<16;mask++){ + const directions=['north','east','south','west']; + const state=Object.fromEntries(directions.map((d,i)=>[d,String(Boolean(mask&(1<!p.when||Object.entries(p.when).every(([k,v])=>String(v)===state[k])).map(p=>p.apply.model); + const connections=directions.filter(d=>state[d]==='true').length; + assert.equal(parts.filter(n=>n.endsWith('_post_ends')).length,1,'post ends '+mask); + assert.equal(parts.filter(n=>n.endsWith('_post')).length,connections===0?1:0,'centre '+mask); + assert.equal(parts.filter(n=>/_cap(_alt)?$/.test(n)).length,connections===1?1:0,'caps '+mask); + assert.equal(parts.filter(n=>/_side(_alt)?$/.test(n)).length,connections,'sides '+mask); + } + assert.equal(templates['models/block/{gem}_bars_post_ends.json'].parent,'minecraft:block/iron_bars_post_ends'); +}); diff --git a/tools/test_port_114.js b/tools/test_port_115.js similarity index 100% rename from tools/test_port_114.js rename to tools/test_port_115.js