Skip to content

Commit ae6fd27

Browse files
committed
Add support for 26.1 Fabric
also bump gradle to 9.4.0, egt to 0.7.0-alpha.5, kotlin gradle plugin to 2.3.0, and loom to 1.15.50
1 parent 010d53f commit ae6fd27

9 files changed

Lines changed: 47 additions & 15 deletions

File tree

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ dependencies {
5555
12108 -> "0.129.0+1.21.8"
5656
12109 -> "0.133.13+1.21.9"
5757
12111 -> "0.141.3+1.21.11"
58+
260100 -> "0.145.1+26.1"
5859
else -> error("Unable to determine fabric api version")
5960
}
6061

buildSrc/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ repositories {
1212

1313
dependencies {
1414
implementation("com.google.code.gson:gson:2.11.0")
15-
implementation("gg.essential:essential-gradle-toolkit:0.6.10")
16-
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.23")
17-
implementation("gg.essential:architectury-loom:1.7.35")
15+
implementation("gg.essential:essential-gradle-toolkit:0.7.0-alpha.5")
16+
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:2.3.0")
17+
implementation("gg.essential:architectury-loom:1.15.50")
1818
}
1919

2020
kotlin {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Thu Jul 04 11:00:49 EDT 2024
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

root.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ plugins {
55
preprocess {
66
strictExtraMappings.set(true)
77

8+
val fabric260100 = createNode("26.1-fabric", 260100, "mojang")
89
val fabric12111 = createNode("1.21.11-fabric", 12111, "yarn")
910
val fabric12109 = createNode("1.21.9-fabric", 12109, "yarn")
1011
val neoForge12108 = createNode("1.21.8-neoforge", 12108, "srg")
@@ -54,6 +55,7 @@ preprocess {
5455
val forge11202 = createNode("1.12.2-forge", 11202, "srg")
5556
val forge10809 = createNode("1.8.9-forge", 10809, "srg")
5657

58+
fabric260100.link(fabric12111, file("versions/26.1-1.21.11.txt"))
5759
fabric12111.link(fabric12109, file("versions/1.21.11-1.21.9.txt"))
5860
fabric12109.link(fabric12108)
5961
neoForge12108.link(fabric12108)

settings.gradle.kts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pluginManagement {
88
maven("https://maven.minecraftforge.net")
99
}
1010
plugins {
11-
id("gg.essential.multi-version.root") version "0.6.10"
11+
id("gg.essential.multi-version.root") version "0.7.0-alpha.5"
1212
}
1313
}
1414

@@ -64,7 +64,8 @@ listOf(
6464
"1.21.8-forge",
6565
"1.21.8-neoforge",
6666
"1.21.9-fabric",
67-
"1.21.11-fabric"
67+
"1.21.11-fabric",
68+
"26.1-fabric"
6869
).forEach { version ->
6970
include(":$version")
7071
project(":$version").apply {

src/main/java/gg/essential/partnermod/EssentialPartner.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ public class EssentialPartner {
8282
"1.18", "1.18.1", "1.18.2",
8383
"1.19", "1.19.1", "1.19.2", "1.19.3", "1.19.4",
8484
"1.20", "1.20.1", "1.20.2", "1.20.4", "1.20.6",
85-
"1.21", "1.21.1", "1.21.2", "1.21.3", "1.21.4", "1.21.5", "1.21.6", "1.21.7", "1.21.8", "1.21.9", "1.21.11"
85+
"1.21", "1.21.1", "1.21.2", "1.21.3", "1.21.4", "1.21.5", "1.21.6", "1.21.7", "1.21.8", "1.21.9", "1.21.11",
86+
"26.1"
8687
));
8788

8889
private static final Set<String> NEOFORGE_SUPPORTED_VERSIONS = new HashSet<>(Arrays.asList(
@@ -321,9 +322,15 @@ public void screenInitEvent(
321322
}
322323
//#else
323324
//$$ private void afterScreenInit(MinecraftClient client, Screen screen, int scaledWidth, int scaledHeight) {
325+
//#if MC >= 260100
326+
//$$ createButton(screen, Screens.getWidgets(screen), (button, idx) -> {
327+
//$$ Screens.getWidgets(screen).add(idx, button);
328+
//$$ });
329+
//#else
324330
//$$ createButton(screen, Screens.getButtons(screen), (button, idx) -> {
325331
//$$ Screens.getButtons(screen).add(idx, button);
326332
//$$ });
333+
//#endif
327334
//$$ }
328335
//#endif
329336

src/main/java/gg/essential/partnermod/modal/ModalManager.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,15 @@ private boolean handleKeyTyped(int key) {
162162
//#if FABRIC
163163
//$$ public void registerEvents() {
164164
//$$ ScreenEvents.BEFORE_INIT.register(((client, screen, scaledWidth, scaledHeight) -> {
165+
//#if MC >= 260100
166+
//$$ ScreenEvents.afterExtract(screen).register(((screen1, graphics, mouseX, mouseY, tickProgress) -> {
167+
//$$ handleDraw(graphics);
168+
//$$ }));
169+
//#else
165170
//$$ ScreenEvents.afterRender(screen).register((screen1, matrices, mouseX, mouseY, tickDelta) -> {
166171
//$$ handleDraw(matrices);
167172
//$$ });
173+
//#endif
168174
//#if MC>=12109
169175
//$$ ScreenMouseEvents.allowMouseClick(screen).register((screen1, click) -> {
170176
//$$ return !handleMouseClick(click.x(), click.y());

versions/1.16.5-forge/src/main/java/gg/essential/partnermod/mixins/Mixin_Screen_OverrideMousePosition.java

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,29 @@
2121

2222
@Mixin(GameRenderer.class)
2323
public class Mixin_Screen_OverrideMousePosition {
24+
//#if MC>=260100
25+
//$$ @Unique
26+
//$$ private static final String RENDER_TARGET = "extractGui";
27+
//$$ @Unique
28+
//$$ private static final String SLICE_ARG = "stringValue=Extracting overlay render state";
29+
//#else
30+
@Unique
31+
private static final String RENDER_TARGET = "updateCameraAndRender";
32+
@Unique
33+
private static final String SLICE_ARG = "stringValue=Rendering overlay";
34+
//#endif
2435

2536
@Unique
2637
private ModalManager.DrawEvent event;
2738

2839
@ModifyVariable(
29-
method = "updateCameraAndRender",
40+
method = RENDER_TARGET,
3041
at = @At(
3142
value = "FIELD",
3243
target = "Lnet/minecraft/client/Minecraft;currentScreen:Lnet/minecraft/client/gui/screen/Screen;",
3344
ordinal = 0
3445
),
35-
slice = @Slice(from = @At(value = "CONSTANT", args = "stringValue=Rendering overlay")),
46+
slice = @Slice(from = @At(value = "CONSTANT", args = SLICE_ARG)),
3647
ordinal = 0
3748
)
3849
public int captureMouseX(int mouseX) {
@@ -41,13 +52,13 @@ public int captureMouseX(int mouseX) {
4152
}
4253

4354
@ModifyVariable(
44-
method = "updateCameraAndRender",
55+
method = RENDER_TARGET,
4556
at = @At(
4657
value = "FIELD",
4758
target = "Lnet/minecraft/client/Minecraft;currentScreen:Lnet/minecraft/client/gui/screen/Screen;",
4859
ordinal = 0
4960
),
50-
slice = @Slice(from = @At(value = "CONSTANT", args = "stringValue=Rendering overlay")),
61+
slice = @Slice(from = @At(value = "CONSTANT", args = SLICE_ARG)),
5162
ordinal = 1
5263
)
5364
public int captureMouseY(int mouseY) {
@@ -60,13 +71,13 @@ public int captureMouseY(int mouseY) {
6071
// but that doesn't matter for the FAKE_MOUSE_POS constant
6172

6273
@ModifyVariable(
63-
method = "updateCameraAndRender",
74+
method = RENDER_TARGET,
6475
at = @At(
6576
value = "FIELD",
6677
target = "Lnet/minecraft/client/Minecraft;currentScreen:Lnet/minecraft/client/gui/screen/Screen;",
6778
ordinal = 0
6879
),
69-
slice = @Slice(from = @At(value = "CONSTANT", args = "stringValue=Rendering overlay")),
80+
slice = @Slice(from = @At(value = "CONSTANT", args = SLICE_ARG)),
7081
ordinal = 0
7182
)
7283
public int modifyMouseX(int mouseX) {
@@ -77,13 +88,13 @@ public int modifyMouseX(int mouseX) {
7788
}
7889

7990
@ModifyVariable(
80-
method = "updateCameraAndRender",
91+
method = RENDER_TARGET,
8192
at = @At(
8293
value = "FIELD",
8394
target = "Lnet/minecraft/client/Minecraft;currentScreen:Lnet/minecraft/client/gui/screen/Screen;",
8495
ordinal = 0
8596
),
86-
slice = @Slice(from = @At(value = "CONSTANT", args = "stringValue=Rendering overlay")),
97+
slice = @Slice(from = @At(value = "CONSTANT", args = SLICE_ARG)),
8798
ordinal = 0
8899
)
89100
public int modifyMouseY(int mouseY) {

versions/26.1-1.21.11.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
net.minecraft.client.gui.GuiGraphicsExtractor net.minecraft.client.gui.DrawContext
2+
net.minecraft.client.gui.GuiGraphicsExtractor blit() drawTexture()
3+
net.minecraft.client.gui.GuiGraphicsExtractor text() drawText()
4+
net.minecraft.client.gui.components.AbstractButton extractContents() drawIcon()

0 commit comments

Comments
 (0)