Build 1.21.8 with Stonecutter from the shared src/
Check / compile (pull_request) Successful in 10m37s
Check / compile (pull_request) Successful in 10m37s
Step 4 of #8, the first version before the 1.21.9 render queue. versions/1.21.8/src is gone; 1.21.8 builds from src/ as :1.21.8. API differences behind version comments (<1.21.9 / >=1.21.9): - Player cosmetics: FeatureRenderer.render takes a VertexConsumerProvider instead of the render queue. The cloak, hat and OBJ renderers name the render target "output" in both, so only the parameter type and the final draw call differ; the OBJ face loop moved into drawGroup. - PlayerEntityRenderer.updateRenderState's entity type, the cape texture accessor, GameProfile getName()/getId() vs name()/id(), fonts in TextMixin, EntityRenderDispatcher vs EntityRenderManager, Screen input events (Click/KeyInput), and KeyBinding categories and isKeyPressed. Features 1.21.9+ lacks stay on 1.21.8, with a TODO for 1.21.9+: - NametagsMixin moves into src/. It hooks renderLabelIfPresent with a VertexConsumerProvider, which 1.21.9 changed, so on 1.21.9+ its body is empty; it stays registered, so features.mixins.json is the same for every version. - The splash screen's loading-bar border, and the real drag deltas in SaturnScreenFabric.mouseDragged. - Status effect icons keep 1.21.8's GUI atlas sprite; 1.21.9+ draws the texture instead (getIconId), as before. Behaviour changes on 1.21.8: the cloak and hat read the Saturn player from the render state (set by PlayerEntityRendererMixin, by UUID) instead of looking it up by name, and the display-name null check applies. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
+8
-4
@@ -7,8 +7,8 @@ How Saturn Client supports several Minecraft versions, and how to change or add
|
||||
Saturn is moving from one full copy of the version-specific code per Minecraft version to a single copy built with [Stonecutter](https://stonecutter.kikugie.dev/) (issue #8). During the move there are two kinds of version:
|
||||
|
||||
- `common/`: all version-independent code (mods, UI, cosmetics, the server client). It has no Minecraft dependency and reaches the game only through the interfaces in `org.saturnclient.common`.
|
||||
- `src/`: the version-specific code (providers, refs, mixins and the three mixin configs) for the versions built by Stonecutter, currently **1.21.9 to 1.21.11**. It's one copy: where Minecraft's API differs between them, the code goes behind version comments (see below). Each of these versions is the Gradle project `:<mc>`, and `versions/<mc>/` holds only its `gradle.properties` (Minecraft, Yarn, Fabric Loader and Fabric API versions), `build/` and `run/`.
|
||||
- `versions/<mc>/src/`: the versions not moved yet (1.21.4 to 1.21.8), each a full copy, as the Gradle project `:mc-<mc>` with its own `build.gradle`.
|
||||
- `src/`: the version-specific code (providers, refs, mixins and the three mixin configs) for the versions built by Stonecutter, currently **1.21.8 to 1.21.11**. It's one copy: where Minecraft's API differs between them, the code goes behind version comments (see below). Each of these versions is the Gradle project `:<mc>`, and `versions/<mc>/` holds only its `gradle.properties` (Minecraft, Yarn, Fabric Loader and Fabric API versions), `build/` and `run/`.
|
||||
- `versions/<mc>/src/`: the versions not moved yet (1.21.4 to 1.21.7), each a full copy, as the Gradle project `:mc-<mc>` with its own `build.gradle`.
|
||||
|
||||
`settings.gradle.kts` lists the Stonecutter versions in `stonecutterVersions` and includes every other folder under `versions/` as `:mc-<mc>`. The root `build.gradle.kts` builds each Stonecutter version, and `stonecutter.gradle.kts` configures the root project (shared repositories, the `common` wiring and `buildAll`). Loom's version for the Stonecutter versions is `loom_version` in the root `gradle.properties`.
|
||||
|
||||
@@ -36,7 +36,11 @@ import net.minecraft.client.render.RenderSetup;
|
||||
|
||||
Stonecutter rewrites inactive code into its own layout when switching versions (a single inactive line becomes `//code`), so write it that way to begin with, or run a switch and a reset before committing.
|
||||
|
||||
When a newer version leaves something out that an older one implements, keep the older version's code behind a condition and mark the newer branch with a `TODO`, rather than dropping it for every version. `WorldFeatureImpl.getWorldAge` and `SaturnScreenFabric.resize` are examples.
|
||||
When a newer version leaves something out that an older one implements, keep the older version's code behind a condition and mark the newer branch with a `TODO`, rather than dropping it for every version. `WorldFeatureImpl.getWorldAge` and `SaturnScreenFabric.resize` are examples. Search for `TODO` to find what newer versions still lack.
|
||||
|
||||
A whole class that only exists for some versions (such as `NametagsMixin`, which hooks a method that 1.21.9 changed) can keep an empty class body on the other versions. An empty mixin changes nothing, and it keeps the mixin configs the same for every version, since JSON can't hold version comments.
|
||||
|
||||
Inactive code sits inside a `/* … */` comment, so it can't contain `/* … */` comments itself: use `//` comments in code that's only active for some versions.
|
||||
|
||||
- `./gradlew "Set active project to <mc>"` (or the Stonecutter IntelliJ plugin) rewrites `src/` so that version's code is the uncommented one, for editing it in the IDE.
|
||||
- `./gradlew "Reset active project"` switches back to 1.21.11. **Run it before committing**, so `src/` is always committed with 1.21.11 active.
|
||||
@@ -51,7 +55,7 @@ Make the change in one version, usually the newest, then run:
|
||||
```sh
|
||||
scripts/port.sh # port uncommitted changes to every other version
|
||||
scripts/port.sh --dry-run # see what would apply cleanly first
|
||||
scripts/port.sh --to 1.21.7,1.21.8 # only some versions
|
||||
scripts/port.sh --to 1.21.6,1.21.7 # only some versions
|
||||
scripts/port.sh --commit <rev> # port what a commit changed instead
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user