Build for Minecraft 26.2
Adds 26.2 as a Stonecutter version (#39). 26.2 splits the HUD out of Gui into Hud and moves the open screen, the overlay and the toasts from Minecraft to Gui. A new Screens helper gets and sets the screen and clears the overlay on every version, and MinecraftClientMixin opens screens through it instead of shadowing Minecraft.setScreen. SetScreenMixin targets Gui.setScreen and the HUD hook Hud.extractChat on 26.2. 26.2's rendering API declares samplers through bind group layouts and gives render targets a GpuFormat, so the glass pipeline adds SAMPLER1's layout and its backdrops are RGBA8_UNORM like vanilla's targets. The main render target is the game renderer's, the panorama no longer takes a fade flag, and toasts are added with SystemToast.add. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
+2
-2
@@ -4,7 +4,7 @@ How Saturn Client supports several Minecraft versions, and how to change or add
|
||||
|
||||
## Layout
|
||||
|
||||
Every supported Minecraft version (1.21.4 to 1.21.11, and 26.1) builds from one copy of the version-specific code with [Stonecutter](https://stonecutter.kikugie.dev/):
|
||||
Every supported Minecraft version (1.21.4 to 1.21.11, 26.1 and 26.2) builds from one copy of the version-specific code with [Stonecutter](https://stonecutter.kikugie.dev/):
|
||||
|
||||
- `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), one copy for every version. Where Minecraft's API differs between versions, the code goes behind version comments (see below).
|
||||
@@ -18,7 +18,7 @@ Minecraft is obfuscated up to 1.21.11 and ships with Mojang's names from 26.1. T
|
||||
|
||||
Every version is built with Mojang's official names (`loom.officialMojangMappings()`), the names Minecraft itself ships from 26.1 on. Yarn isn't used any more: 1.21.11 has the last Yarn release.
|
||||
|
||||
Mojang renames things between versions. `src/` uses the active version's (1.21.11's) names, and `stonecutter.gradle.kts` lists replacements that swap in each version's name when Stonecutter processes it: for example `Identifier`, which was `ResourceLocation` before 1.21.11, `AvatarRenderState`, which was `PlayerRenderState` before 1.21.9, and `GuiGraphics`, which is `GuiGraphicsExtractor` from 26.1. Add a replacement there when a rename touches many lines. A class that only moved package needs just a version comment on its import, and a renamed method a version comment where it's called.
|
||||
Mojang renames things between versions. `src/` uses the active version's (1.21.11's) names, and `stonecutter.gradle.kts` lists replacements that swap in each version's name when Stonecutter processes it: for example `Identifier`, which was `ResourceLocation` before 1.21.11, `AvatarRenderState`, which was `PlayerRenderState` before 1.21.9, and `GuiGraphics`, which is `GuiGraphicsExtractor` from 26.1. Add a replacement there when a rename touches many lines. From 26.2 the open screen and overlay live on `Gui` rather than `Minecraft`, so code goes through `impl.ui.Screens` for them. A class that only moved package needs just a version comment on its import, and a renamed method a version comment where it's called.
|
||||
|
||||
Released 1.21.x jars run on intermediary names (`method_1234`), not Mojang's, and Loom renames everything that refers to Minecraft when it builds them. So a mixin can't implement one of `common`'s Ref interfaces by relying on a vanilla method that happens to have the same name: the vanilla method is renamed in the jar, and the interface method is left without an implementation (`AbstractMethodError`). Shadow the vanilla method and implement the Ref method explicitly, as `WindowMixin` does. For the same reason, Ref methods mustn't share a name and parameters with a method of the class they're mixed into, or the mixin replaces the vanilla method in development.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user