From 4a59fb5d0243dcde8cfcdeaa7eb7f0eee4bee37b Mon Sep 17 00:00:00 2001 From: Dustin Norberg Date: Sat, 14 Nov 2026 12:17:49 -0500 Subject: [PATCH] Complete 26.3 parity acceptance and dual-version release workflow --- .gitea/workflows/build.yml | 64 ++++ .github/workflows/build.yml | 69 +++- README.md | 7 + docs/DUAL_VERSION_RELEASE.md | 57 ++- docs/MC263_PARITY_REVIEW.md | 79 +++++ docs/MINECRAFT_26_3_PORT.md | 12 + ports/mc263/README.md | 16 +- ports/mc263/RELEASE_NOTES_26.3.0.3.md | 38 ++ ports/mc263/gradle.properties | 2 +- .../client/PortBookExploration.java | 120 +++++++ .../rivencraft/client/PortBookPreview.java | 6 + .../client/PortDescriptiveBookScreen.java | 10 +- .../client/PortLegacyLinkPanel.java | 4 +- .../client/PortLinkingBookScreen.java | 10 +- .../client/RebornLiveBookPanel.java | 44 ++- .../templates/META-INF/neoforge.mods.toml | 4 +- scripts/changed_targets.py | 32 ++ .../rivencraft/regression/MatrixClient.java | 58 ++++ .../rivencraft/regression/MatrixPayloads.java | 25 ++ .../rivencraft/regression/MatrixServer.java | 208 +++++++++++ scripts/publish_mod_sites.py | 41 ++- scripts/regression_multiplayer_263.py | 166 +++++++++ scripts/server_test_lock.py | 18 + scripts/smoke_server.py | 121 +++++++ scripts/smoke_server_263.sh | 325 +----------------- scripts/test_release_workflow.py | 74 ++++ 26 files changed, 1241 insertions(+), 369 deletions(-) create mode 100644 .gitea/workflows/build.yml create mode 100644 docs/MC263_PARITY_REVIEW.md create mode 100644 ports/mc263/RELEASE_NOTES_26.3.0.3.md create mode 100644 ports/mc263/src/main/java/net/dnorberg/rivencraft/client/PortBookExploration.java create mode 100644 scripts/changed_targets.py create mode 100644 scripts/fixtures/mc263_multiplayer/net/dnorberg/rivencraft/regression/MatrixClient.java create mode 100644 scripts/fixtures/mc263_multiplayer/net/dnorberg/rivencraft/regression/MatrixPayloads.java create mode 100644 scripts/fixtures/mc263_multiplayer/net/dnorberg/rivencraft/regression/MatrixServer.java create mode 100644 scripts/regression_multiplayer_263.py create mode 100644 scripts/server_test_lock.py create mode 100644 scripts/smoke_server.py create mode 100644 scripts/test_release_workflow.py diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 0000000..f59d4c2 --- /dev/null +++ b/.gitea/workflows/build.yml @@ -0,0 +1,64 @@ +name: Build and smoke + +on: [push, pull_request] + +permissions: + contents: read + +jobs: + changes: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.targets.outputs.matrix }} + any: ${{ steps.targets.outputs.any }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Check release workflow safeguards + run: python3 scripts/test_release_workflow.py -v + - id: targets + env: + BASE: ${{ github.event.pull_request.base.sha || github.event.before }} + run: | + base="$BASE" + if [ -z "$base" ] || ! git cat-file -e "$base^{commit}" 2>/dev/null; then + base=$(git rev-parse HEAD^) + fi + matrix=$(python3 scripts/changed_targets.py --base "$base") + echo "matrix=$matrix" >> "$GITHUB_OUTPUT" + if [ "$matrix" = '{"include":[]}' ]; then + echo "any=false" >> "$GITHUB_OUTPUT" + else + echo "any=true" >> "$GITHUB_OUTPUT" + fi + build: + needs: changes + if: needs.changes.outputs.any == 'true' + runs-on: ubuntu-latest + timeout-minutes: 20 + strategy: + fail-fast: false + max-parallel: 1 + matrix: ${{ fromJSON(needs.changes.outputs.matrix) }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + - uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java }} + distribution: temurin + - uses: gradle/actions/setup-gradle@v4 + - name: Build Minecraft target + run: ./gradlew ${{ matrix.gradle_args }} --console=plain + - name: Disposable dedicated-server smoke + run: python3 scripts/smoke_server.py --target ${{ matrix.target }} + - name: Keep smoke logs + if: always() + uses: actions/upload-artifact@v3 + with: + name: smoke-${{ matrix.target }} + path: build/verification/${{ matrix.target }}/*.log + if-no-files-found: ignore diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 63c3cde..e7f2713 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,25 +1,64 @@ -name: Build +name: Build and smoke on: [push, pull_request] +permissions: + contents: read + jobs: - build: + changes: runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.targets.outputs.matrix }} + any: ${{ steps.targets.outputs.any }} steps: - - name: Checkout repository - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Check release workflow safeguards + run: python3 scripts/test_release_workflow.py -v + - id: targets + env: + BASE: ${{ github.event.pull_request.base.sha || github.event.before }} + run: | + base="$BASE" + if [ -z "$base" ] || ! git cat-file -e "$base^{commit}" 2>/dev/null; then + base=$(git rev-parse HEAD^) + fi + matrix=$(python3 scripts/changed_targets.py --base "$base") + echo "matrix=$matrix" >> "$GITHUB_OUTPUT" + if [ "$matrix" = '{"include":[]}' ]; then + echo "any=false" >> "$GITHUB_OUTPUT" + else + echo "any=true" >> "$GITHUB_OUTPUT" + fi + build: + needs: changes + if: needs.changes.outputs.any == 'true' + runs-on: ubuntu-latest + timeout-minutes: 20 + strategy: + fail-fast: false + max-parallel: 1 + matrix: ${{ fromJSON(needs.changes.outputs.matrix) }} + steps: + - uses: actions/checkout@v4 with: fetch-depth: 0 fetch-tags: true - - - name: Setup JDK 21 - uses: actions/setup-java@v4 + - uses: actions/setup-java@v4 with: - java-version: '21' - distribution: 'temurin' - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 - - - name: Build with Gradle - run: ./gradlew build \ No newline at end of file + java-version: ${{ matrix.java }} + distribution: temurin + - uses: gradle/actions/setup-gradle@v4 + - name: Build Minecraft target + run: ./gradlew ${{ matrix.gradle_args }} --console=plain + - name: Disposable dedicated-server smoke + run: python3 scripts/smoke_server.py --target ${{ matrix.target }} + - name: Keep smoke logs + if: always() + uses: actions/upload-artifact@v4 + with: + name: smoke-${{ matrix.target }} + path: build/verification/${{ matrix.target }}/*.log + if-no-files-found: ignore diff --git a/README.md b/README.md index 7e57f30..32a98b0 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,13 @@ See the [26.3 guide](ports/mc263/README.md) and [release notes](ports/mc263/RELEASE_NOTES_26.3.0.1.md). Keep the builds and their saves separate, and back up worlds before updating. +Minecraft **26.3** is also supported through a separate **Java 25 / NeoForge +26.3.0.99** release with a first-party Age backend. See the +[26.3 guide](ports/mc263/README.md) and +[parity review](docs/MC263_PARITY_REVIEW.md). Keep the game-version JARs and saves +separate; 1.21.1 remains supported with its existing dependencies. The guide below +describes 1.21.1 unless stated otherwise. + ## Getting started 1. Make an Ink Vial from two black dyes, a glass bottle, and a water bucket. diff --git a/docs/DUAL_VERSION_RELEASE.md b/docs/DUAL_VERSION_RELEASE.md index 8f2d634..9878042 100644 --- a/docs/DUAL_VERSION_RELEASE.md +++ b/docs/DUAL_VERSION_RELEASE.md @@ -43,11 +43,62 @@ JARs; use new worlds and remove them regardless of pass/fail. Stop test processe If generation stalls, hand the test to the user. Before closing a port umbrella issue, compare its acceptance criteria and comments -to actual evidence. Current expanded-catalog two-client create/travel/reconnect/ -restart/stale-ack regression remains in #100. #103 retains dual-line release -automation/regression completion and #104 retains the full parity gate. +to actual evidence. The expanded-catalog matrix and manual restart/return handoff completed in #100. +See [the final parity review](MC263_PARITY_REVIEW.md) for evidence and limits. Shared issues need both versions resolved before closure. For each release, document tested optional versions and no-optional fallbacks, match client/server JARs, preserve the independent 1.21.1 support line, update wiki and platform descriptions, and keep known bugs linked in the release notes. + +## Changed-target validation policy + +Only test a Minecraft target when its code/resources changed. Select targets with +`python3 scripts/changed_targets.py --base `. Shared assets can select +both; temporary servers must run sequentially. Earlier gameplay sign-off remains +valid for unchanged 1.21.1 code. + +Repeatable local checks: + +- Java 21 / 1.21.1: `./gradlew build --console=plain`. +- Java 25 / 26.3: `./gradlew -p ports/mc263 build --console=plain`. +- Smoke one changed target: `python3 scripts/smoke_server.py --target mc1211` + or `--target mc263`. +- Two-client 26.3 acceptance: `python3 scripts/regression_multiplayer_263.py`. + Fixture sources remain outside the shipping JAR. If a test stalls, stop it, + preserve logs, delete temporary worlds and hand the remaining check to the user. + Do not automatically retry. + +GitHub and Gitea workflow definitions select changed targets and use +`max-parallel: 1`. Hosted execution is not yet verified. Repository runner +inventory alone does not establish availability of instance-wide runners. +The publisher checks embedded version/Minecraft metadata, Java selection, +filename identity, absence of test fixtures and required 1.21.1 dependencies. + +Apply relevant fixes to both supported lines, with separate implementation and +validation per target. Keep version-specific fixes on the affected line. Advancing +the newer Minecraft/NeoForge target requires a compatibility audit and must not +silently replace 1.21.1 support or widen an existing JAR dependency range. + +## Current acceptance evidence (2026-11-14) + +26.3.0.3 builds and the user passed book-window mouse-look, right-click return +and re-entry. Beta branding is removed. The release collects these changes, +the workflow tools and the final parity review. + +The expanded-catalog dedicated matrix ran with two real clients. Both received +runtime-created Ages and authored environment data, traveled using normal books, +and passed stale-ack rejection/recovery, occupied-unload refusal, empty-Age +reload/reseed and retirement checks. After full server restart both reconnected in +the surviving Age with its saved seed and presentation, without the retired Age. +The run stalled at the final post-restart return Linking Book step (phase 22). +It was stopped, temporary worlds deleted, and the last check handed off rather +than retried. Singleplayer preview sign-off does not replace that dedicated check. + +The player completed the manual dedicated-server restart/return check on +2026-11-14 and explicitly accepted #100. This was one player-operated client, +complementing the automated two-client evidence; it is not described as a new +automated two-client pass. The test server was stopped, logs retained under +build/verification/issue100-manual, and its temporary world removed. +See [the final parity review](MC263_PARITY_REVIEW.md). Renderer bug #116 remains +separately tracked. #103/#104 and parent #96 close after release verification. diff --git a/docs/MC263_PARITY_REVIEW.md b/docs/MC263_PARITY_REVIEW.md new file mode 100644 index 0000000..67871ad --- /dev/null +++ b/docs/MC263_PARITY_REVIEW.md @@ -0,0 +1,79 @@ +# 26.3 port parity and acceptance review + +Reviewed 2026-11-14 for 26.3.0.3 against the independently maintained 1.21.1 +implementation. This closes the port feature checklist, not every open bug or +future enhancement. The dated development entries in MINECRAFT_26_3_PORT.md +retain their original evidence and are superseded by later slices where stated. + +## Feature comparison + +| Area | 1.21.1 implementation | 26.3 counterpart / acceptance | +| --- | --- | --- | +| Page language | Ordered writing, registry-backed pages, modifiers, recovery and corrupted pages | PortAuthoredWriting, PortWritingRecovery, PortMaterialCompletion, PortRegistryPages and the shared symbol resources retain source writing, material pairing and diagnostics. Port slices received player sign-off. | +| Ink Mixer | Paper/ink, additive modifiers, vial/bottle exchange and output reset | InkMixerMenu/Screen, InkModifierIngredients and InkVialExchange port the interaction and assets. One ink and paper per panel; additives reset on removal. The separate 1.21.1 correction remains a shared follow-up. | +| Page storage | Notebook, folders, portfolios, sealed notebooks | NotebookMenu/Screen and the corresponding item components port sparse storage, selection/moving, held-slot protection and bulk import. Legacy glyph/page assets reused. | +| Desk / Binder | Tab catalog, ink/paper copy transactions, collection input, named books and OP diagnostics | WritingDeskMenu/Screen, WritingDeskCatalog and PortBookBinderMenu/Screen with authoritative networking and existing textures/models. Input, output pickup and naming fixes passed in game. | +| Link Modifier | Name, properties, seed and retirement | LinkModifierMenu/Screen and explicit edit payloads provide six property controls, title/seed edits and guarded retirement. Player-approved before this audit. | +| Terrain and biomes | Standard/amplified/flat/cave/void/sky-island profiles and biome distributions | PortAgeTerrain, PortBiomePlan, native registry biome pools and first-party generators. Authored and random plans persist their own seeds. Version-specific terrain/biome follow-ups remain separate. | +| Decorations and structures | Material features, vegetation, lakes, carvers, vanilla structures, libraries, crystals and fissures | Port terrain/vegetation/lake/carver/structure plans and generation passes implement these families, with modern structures and registry-backed materials. Family-specific terrain restrictions are retained; this audit does not claim every possible combination can generate. | +| Time, sky and celestials | Authored/random bodies, number/color modifiers, time modes, eclipses and ambient lighting | PortDayCycle, PortAgeColors, PortCelestialDiscs and sky/light mixins; colors, multiple bodies, sizes, positions, frozen time and eclipse rendering received player checks. Static Sky with Reborn has known bug #116. | +| Weather and seasons | Per-Age weather and optional Serene policies | PortWeatherMode, PortSeasonPolicies and Serene adapters preserve independent Age policy. Serene is optional; Ecliptic integration remains deferred on both lines. | +| Instability | Writing and live material scores, provider plans, effects and operator controls | PortInstabilityData/Plan/Runtime, block profiling, status/decay/hazard/meteor/environment providers and operator commands. Scores remain OP-only. Accelerated ticks use bounded loaded-world budgets; machine parity work remains tracked separately. | +| Travel | Handheld books, stands, receptacles, portals, footing/platform, modifiers and return links | Shared port destination/travel services, PortalTravelQueue and CrystalPortalNetwork keep book properties authoritative. Return links default disabled. Unsafe or unsynchronized travel leaves the player at source. | +| Presentation | Legacy books/pages/models/sounds, dropped open books and preview renderers | Existing assets reused through 26.3 extracted render states and modern input. Live Reborn book/portal views and look-only exploration are implemented; right-click return/re-entry passed on 26.3.0.3. | +| Discovery / guides | Libraries, loot, crafting, advancements, creative pages and JEI | Libraries/stands, sealed notebook discovery, progression and JEI guides ported. Random eligibility controls apply to new random choices/loot while existing authored pages remain usable. | +| Backend lifecycle | Dynamic Dimensions AR plus catalog/travel behavior | Rivencraft-owned backend with atomic creation, seed persistence, catalog acknowledgement, unload/reseed/retire. #99/#101 and now #100 accepted. | + +## Deliberate platform differences + +- Java 21 / NeoForge 21.1.264 and Dynamic Dimensions AR + Bad Packets stay on + 1.21.1. The tested 26.3 target uses Java 25 / NeoForge 26.3.0.99 and a first-party + Age backend. No optional integration is bundled or made mandatory. +- 26.3 starts fresh saves. Importing 1.21.1 dimension/save internals is unsupported. + New chunk algorithms and random streams need not produce identical terrain. +- Create/Ponder has no ported 26.3 integration. Built-in animation is always + available; Reborn 7.0.12 provides optional live book/crystal views and look-only + exploration. Seamless has the dimension bridge, not this Reborn rendering path. +- Optional libraries, registry contents and vanilla generation APIs differ across + game versions. Changes to shared symbols/assets must be considered for both; + version-specific implementations and dependency requirements stay separate. +- Shared requested enhancements in #105–#115 and renderer bug #116 are separate + work. Port closure does not close those issues or describe their work as done. + +## Regression evidence and limits + +Earlier recorded 1.21.1 client/dedicated/optional-mod sign-offs remain valid: +its game code did not change during this work, so it was not retested merely +because the 26.3 target changed. Both build targets were built during the workflow +audit; only changed-target gameplay checks are required going forward. + +The expanded-catalog 26.3 test used two actual clients on one dedicated server. +Runtime Age creation, catalog/environment delivery, normal-book travel, +stale-ack rejection/recovery, occupied unload refusal, empty reload/reseed and +retirement passed. On full restart both reconnected in the surviving Age with +the saved seed/presentation; retired data stayed absent. The final return-book +step stalled and was handed off without retry, per the user's instruction. + +The player then created and entered an Age on the current local dedicated server +with the Dev optional stack, requested a full restart, reconnected, and returned +to the Overworld by Linking Book. Server logs confirm restored Age +rivencraft:age/random, seed -1985136355166262436, and the Overworld return. +The player explicitly accepted #100. This final handoff used one player-operated +client, not a new two-client automated pass. Logs are retained locally under +build/verification; temporary worlds and server processes were removed. + +Production 26.3.0.3 builds and its book-window look/exit/re-entry received an +in-game pass. Earlier slices record no-optional startup, generation, portal +geometry/lifecycle and optional integration checks. This is cumulative evidence, +not a claim that every historical test was rerun on the final JAR. + +## Release gate + +[DUAL_VERSION_RELEASE.md](DUAL_VERSION_RELEASE.md) defines changed-target builds, +sequential temporary servers, stalled-test handoff, maintenance policy and upload +identity checks. Offline tooling checks cover track selection, release naming, +required dependencies, wrong-artifact/fixture rejection and server exclusion. +Hosted workflow execution remains unverified; repeatable local commands provide +the supported fallback. Release acceptance is recorded in Gitea after publication +and artifact verification. The existing published 1.21.1 release is retained; +unchanged code is not republished merely to adopt the new filename scheme. diff --git a/docs/MINECRAFT_26_3_PORT.md b/docs/MINECRAFT_26_3_PORT.md index 599b64c..5e92392 100644 --- a/docs/MINECRAFT_26_3_PORT.md +++ b/docs/MINECRAFT_26_3_PORT.md @@ -8,6 +8,18 @@ The user wants both Minecraft lines maintained after the port, not a one-time 26.3 release. Gitea milestone "Dual-version support: 1.21.1 and 26.3" tracks issues #97–#103 under parent #96. +## Final port acceptance — 2026-11-14 + +The 26.3 port is playable on the regular release channel. The complete writing, +generation, instability, travel, discovery and presentation review is in +[MC263_PARITY_REVIEW.md](MC263_PARITY_REVIEW.md). #100 is complete: the +expanded-catalog two-client checks and the player-operated full-restart return +handoff passed. The look-only book-window overlay and its right-click exit fix +also passed on 26.3.0.3. #103/#104 closure follows the workflow/release audit. +The original introductory audit and slice entries below are historical, not a +list of currently missing features. 1.21.1 remains maintained independently. +Known issues and shared enhancements remain tracked separately. + ## Published status — 2026-11-11 [26.3.0.1](../ports/mc263/RELEASE_NOTES_26.3.0.1.md) collects the player-validated diff --git a/ports/mc263/README.md b/ports/mc263/README.md index 954e8e3..a416a65 100644 --- a/ports/mc263/README.md +++ b/ports/mc263/README.md @@ -1,6 +1,6 @@ -# Minecraft 26.3 beta port workspace +# Minecraft 26.3 -The current **Minecraft 26.3 release is 26.3.0.1**, for NeoForge 26.3.0.99 and +The current **Minecraft 26.3 release is 26.3.0.3**, for NeoForge 26.3.0.99 and Java 25. It uses Rivencraft's first-party Age backend, with no Dynamic Dimensions or Bad Packets dependency. The writing loop, authored/seeded Ages, generation features, weather/skies/celestials, libraries, crystal portals, live instability, @@ -16,11 +16,13 @@ with `book_previews.reborn_live_views` in `rivencraft-local.toml`. Reborn's Static Sky rendering issue remains tracked in [#116](https://git.paddedcell.org/dnorberg/rivencraft/issues/116). -This regular release is player-validated but does not claim complete 1.21.1 parity. -Issues #100, #103 and #104 retain the final multiplayer/parity/release-workflow -checks. Preview exploration controls and Create/Ponder scenes remain unported. -Use matching client/server builds, keep saves separate from 1.21.1 and back up -before updating. See [release notes](RELEASE_NOTES_26.3.0.1.md). +The port feature and acceptance review is recorded in +[the parity review](../../docs/MC263_PARITY_REVIEW.md). Book exploration matches +1.21.1: use the eye for mouse look inside the book panel and right-click to return; +movement is disabled. The final dedicated-server restart/return check passed. +Create/Ponder scenes are not ported to this target. Use matching client/server +builds, keep saves separate from 1.21.1 and back up before updating. +See [release notes](RELEASE_NOTES_26.3.0.3.md). The entries below record how the port was built, including earlier alpha-only limitations that were addressed by later slices. diff --git a/ports/mc263/RELEASE_NOTES_26.3.0.3.md b/ports/mc263/RELEASE_NOTES_26.3.0.3.md new file mode 100644 index 0000000..5897639 --- /dev/null +++ b/ports/mc263/RELEASE_NOTES_26.3.0.3.md @@ -0,0 +1,38 @@ +# Rivencraft 26.3.0.3 + +For **Minecraft 26.3**, **NeoForge 26.3.0.99** and **Java 25**. + +## Book preview exploration + +- The eye button now matches 1.21.1: it grabs the mouse for look-only exploration + while the destination view remains inside the book panel. Movement is disabled. +- Right-click returns to the ordinary book controls without releasing the preview. + Books on stands retain their disabled exploration button. +- Fixed the exit crash caused by a forced render and duplicate Reborn render-target + submission. Pending target submissions are reused until the renderer drains them. +- Removed remaining Beta branding from the in-game mod name/description. + +## Port acceptance and maintenance + +- Completed dedicated-server restart/return-link acceptance for #100, following + the two-client matrix and its manual handoff. The player confirmed return travel. +- Added changed-target build/smoke workflows, sequential test-server exclusion and + repeatable dual-version validation commands. +- Hardened release uploads against mismatched filename, embedded version, + Minecraft/Java target and accidental test-fixture packaging. The 1.21.1 metadata + declares its required Dynamic Dimensions AR and Bad Packets dependencies. +- Documented the feature parity review and ongoing independent support of 1.21.1. + Existing 1.21.1 code and published artifacts are unchanged. + +## Validation and known issues + +The player passed the live-view exploration/right-click/re-entry check and the +dedicated-server Age restart/Linking Book return check. The expanded-catalog +two-client matrix passed creation/catalog/travel/stale-ack/lifecycle checks; +its final return step stalled and was completed by the player, not retried. +Release-tooling checks pass. No optional mod or test fixture is bundled. + +**Known issue #116:** Static Sky can leak outside book previews with Reborn. +It remains separately tracked. Other shared follow-ups remain open where needed. +Create/Ponder is not ported to 26.3. Without Reborn, built-in animated previews +and normal book/portal travel remain available. 1.21.1 saves are not imported. diff --git a/ports/mc263/gradle.properties b/ports/mc263/gradle.properties index d877f69..39df0b0 100644 --- a/ports/mc263/gradle.properties +++ b/ports/mc263/gradle.properties @@ -7,7 +7,7 @@ neo_version=26.3.0.99 mod_id=rivencraft mod_name=Rivencraft mod_license=LGPL-3.0-or-later -mod_version=26.3.0.1 +mod_version=26.3.0.3 jei_version=31.17.0.109 diff --git a/ports/mc263/src/main/java/net/dnorberg/rivencraft/client/PortBookExploration.java b/ports/mc263/src/main/java/net/dnorberg/rivencraft/client/PortBookExploration.java new file mode 100644 index 0000000..6ff83ad --- /dev/null +++ b/ports/mc263/src/main/java/net/dnorberg/rivencraft/client/PortBookExploration.java @@ -0,0 +1,120 @@ +package net.dnorberg.rivencraft.client; + +import net.dnorberg.rivencraft.Rivencraft; +import net.minecraft.client.KeyMapping; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.components.Button; +import net.minecraft.client.gui.components.Tooltip; +import net.minecraft.client.gui.screens.Screen; +import net.minecraft.network.chat.Component; +import net.minecraft.world.phys.Vec3; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.EventBusSubscriber; +import net.neoforged.neoforge.client.event.ClientTickEvent; +import net.neoforged.neoforge.client.event.InputEvent; +import net.neoforged.neoforge.client.event.RenderGuiEvent; +import com.mojang.blaze3d.platform.InputConstants; + +/** Matches 1.21.1: grabbed mouse look with the book drawn over the source world. */ +@EventBusSubscriber(modid = Rivencraft.MOD_ID, value = Dist.CLIENT) +public final class PortBookExploration { + private static PortBookExploration current; + private final PortLegacyLinkPanel panel; + private Screen owner; + private Button eye; + private Vec3 sourcePosition; + private net.minecraft.client.multiplayer.ClientLevel sourceLevel; + private int guiWidth, guiHeight; + private boolean active; + + PortBookExploration(PortLegacyLinkPanel panel) { this.panel = panel; } + + void attach(Screen screen, java.util.function.Consumer