Build 1.21.7 with Stonecutter from the shared src/
Step 5 of #8. versions/1.21.7/src is gone; 1.21.7 builds from src/ as :1.21.7. 1.21.7's copy differed from 1.21.8's in the player render state: Fabric API's RenderStateDataKey only exists from 1.21.8 (fabric-rendering-v1 12.6.0), so 1.21.7 had no updateRenderState hook, no SaturnRenderState, and looked players up by name for the cloak and hat. That stays the case: - The cloak and hat use getData on >=1.21.8 and SaturnPlayer.get(name) before that. - PlayerEntityRendererMixin's updateRenderState exists only on >=1.21.8, as flat ranges (>=1.21.9, else if >=1.21.8) calling a shared saturn$applyPlayer helper, instead of nested version blocks. - SaturnRenderState's key only exists on >=1.21.8; the class is empty before. - TODO: 1.21.6 and 1.21.7 still don't show the role icon in names. 1.21.7's NameTagMixin isn't carried over: it wasn't registered in any mixin config, so it never ran. The 1.21.7 jar differs from the old one only as 1.21.8's did in step 4 (entityAlpha and drawGroup helpers, getIconId, and the cloak getting its buffer at the draw call), plus the empty SaturnRenderState and the missing dead NameTagMixin. 1.21.8-1.21.11 only differ in PlayerEntityRendererMixin (the helper). Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
+4
-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.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`.
|
||||
- `src/`: the version-specific code (providers, refs, mixins and the three mixin configs) for the versions built by Stonecutter, currently **1.21.7 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.6), 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`.
|
||||
|
||||
@@ -40,7 +40,7 @@ When a newer version leaves something out that an older one implements, keep the
|
||||
|
||||
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.
|
||||
Inactive code sits inside a `/* … */` comment, so it can't contain `/* … */` comments itself: use `//` comments in code that's only active for some versions. For the same reason, don't nest multi-line version blocks; use `//?} else if <condition> {` for more than two version ranges, as in `PlayerEntityRendererMixin` and `SaturnRenderState`.
|
||||
|
||||
- `./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.
|
||||
@@ -55,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.6,1.21.7 # only some versions
|
||||
scripts/port.sh --to 1.21.5,1.21.6 # only some versions
|
||||
scripts/port.sh --commit <rev> # port what a commit changed instead
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user