Skip to content

Commit 5b9aa2e

Browse files
Add support for 1.21.6 Fabric
1 parent ccdc60e commit 5b9aa2e

File tree

10 files changed

+25
-10
lines changed

10 files changed

+25
-10
lines changed

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ dependencies {
5050
12103 -> "0.106.1+1.21.3"
5151
12104 -> "0.115.1+1.21.4"
5252
12105 -> "0.119.0+1.21.5"
53+
12106 -> "0.125.1+1.21.6"
5354
else -> error("Unable to determine fabric api version")
5455
}
5556

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
essential.defaults.loom=1
2-
essential.defaults.loom.fabric-loader=net.fabricmc:fabric-loader:0.16.10
3-
org.gradle.jvmargs=-Xmx2G
2+
essential.defaults.loom.fabric-loader=net.fabricmc:fabric-loader:0.16.14
3+
org.gradle.jvmargs=-Xmx4G
44
# TODO remove once upgrading to Loom 1.10
55
# fabric-api 1.21.5 was built with Loom 1.10, seems to work well enough in dev with our current 1.7 though
66
loom.ignoreDependencyLoomVersionValidation=true

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 fabric12106 = createNode("1.21.6-fabric", 12106, "yarn")
89
val neoForge12105 = createNode("1.21.5-neoforge", 12105, "srg")
910
val forge12105 = createNode("1.21.5-forge", 12105, "srg")
1011
val fabric12105 = createNode("1.21.5-fabric", 12105, "yarn")
@@ -45,6 +46,7 @@ preprocess {
4546
val forge11202 = createNode("1.12.2-forge", 11202, "srg")
4647
val forge10809 = createNode("1.8.9-forge", 10809, "srg")
4748

49+
fabric12106.link(fabric12105, file("versions/1.21.6-1.21.5.txt"))
4850
neoForge12105.link(fabric12105)
4951
forge12105.link(fabric12105)
5052
fabric12105.link(fabric12104)

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ listOf(
5656
"1.21.5-fabric",
5757
"1.21.5-forge",
5858
"1.21.5-neoforge",
59+
"1.21.6-fabric",
5960
).forEach { version ->
6061
include(":$version")
6162
project(":$version").apply {

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818

1919
import java.util.function.Consumer;
2020

21-
//#if MC>=12102
21+
//#if MC>=12106
22+
//$$ import net.minecraft.client.gl.RenderPipelines;
23+
//#elseif MC>12102
2224
//$$ import net.minecraft.client.render.RenderLayer;
2325
//#endif
2426

@@ -100,7 +102,9 @@ public AdButton(int x, int y, ResourceLocation texture, Consumer<GuiButton> onPr
100102
//$$ RenderSystem.color4f(1f, 1f, 1f, this.alpha);
101103
//#endif
102104
//$$
103-
//#if MC>=12105
105+
//#if MC>=12106
106+
//$$ context.drawTexture(RenderPipelines.GUI_TEXTURED, texture, this.getX(), this.getY(), x, 0, width, height, width * 2, height, ColorHelper.getWhite(this.alpha));
107+
//#elseif MC>=12105
104108
//$$ context.drawTexture(RenderLayer::getGuiTextured, texture, this.getX(), this.getY(), x, 0, width, height, width * 2, height, ColorHelper.getWhite(this.alpha));
105109
//#elseif MC>=12102
106110
//$$ context.drawTexture(RenderLayer::getGuiTextured, texture, this.getX(), this.getY(), x, 0, width, height, width * 2, height);

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
import java.util.List;
2121
import java.util.function.Consumer;
2222

23-
//#if MC>12102
23+
//#if MC>=12106
24+
//$$ import net.minecraft.client.gl.RenderPipelines;
25+
//#elseif MC>12102
2426
//$$ import net.minecraft.client.render.RenderLayer;
2527
//#endif
2628

@@ -74,7 +76,9 @@ public void texturedRect(ResourceLocation texture, int x, int y, int width, int
7476
}
7577

7678
public void texturedRect(ResourceLocation texture, int x, int y, int width, int height, int u, int v, int textureWidth, int textureHeight, int color) {
77-
//#if MC>=12102
79+
//#if MC>=12106
80+
//$$ drawContext.drawTexture(RenderPipelines.GUI_TEXTURED, texture, x, y, u, v, width, height, textureWidth, textureHeight, color);
81+
//#elseif MC>=12102
7882
//$$ drawContext.drawTexture(RenderLayer::getGuiTextured, texture, x, y, u, v, width, height, textureWidth, textureHeight, color);
7983
//#else
8084
float red = ((color >> 16) & 0xFF) / 255f;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public class EssentialPartner {
8080
"1.18", "1.18.1", "1.18.2",
8181
"1.19", "1.19.1", "1.19.2", "1.19.3", "1.19.4",
8282
"1.20", "1.20.1", "1.20.2", "1.20.4", "1.20.6",
83-
"1.21", "1.21.1", "1.21.2", "1.21.3", "1.21.4", "1.21.5"
83+
"1.21", "1.21.1", "1.21.2", "1.21.3", "1.21.4", "1.21.5", "1.21.6"
8484
));
8585

8686
private static final Set<String> NEOFORGE_SUPPORTED_VERSIONS = new HashSet<>(Arrays.asList(

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ private void handleDraw(
103103
) {
104104
resetMousePosition();
105105

106-
//#if MC>=12000
106+
//#if MC>=12000 && MC<12106
107107
//$$ MatrixStack stack = drawContext.getMatrices();
108108
//#endif
109109

110-
//#if MC>=11600
110+
//#if MC>=11600 && MC<12106
111111
//$$ stack.push();
112112
//$$ stack.translate(0, 0, 10f);
113113
//#endif
@@ -125,7 +125,7 @@ private void handleDraw(
125125
handleDraw(draw);
126126
Draw.flushDeferred(draw);
127127

128-
//#if MC>=11600
128+
//#if MC>=11600 && MC<12106
129129
//$$ stack.pop();
130130
//#endif
131131
}

versions/1.21.6-1.21.5.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
net.minecraft.GameVersion id() getId()
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
essential.defaults.loom.minecraft=com.mojang:minecraft:1.21.6
2+
essential.defaults.loom.mappings=net.fabricmc:yarn:1.21.6+build.1:v2

0 commit comments

Comments
 (0)