From 9a121840dcb5cc9861df2ee29bca59f1f67a0448 Mon Sep 17 00:00:00 2001 From: Kel Cuprum Date: Sun, 25 Aug 2024 19:41:38 +0300 Subject: [PATCH 1/5] Update for 24w34a (1.21.2) (#772) - Update for 24w31a --- build.gradle | 2 +- gradle.properties | 12 ++++++------ gradle/wrapper/gradle-wrapper.properties | 2 +- .../com/terraformersmc/modmenu/gui/ModsScreen.java | 3 ++- .../modmenu/gui/widget/DescriptionListWidget.java | 5 +++-- .../gui/widget/LegacyTexturedButtonWidget.java | 3 ++- .../modmenu/gui/widget/ModListWidget.java | 5 +++-- .../modmenu/gui/widget/UpdateAvailableBadge.java | 3 ++- .../modmenu/gui/widget/entries/ModListEntry.java | 7 ++++--- .../modmenu/gui/widget/entries/ParentEntry.java | 3 ++- 10 files changed, 26 insertions(+), 19 deletions(-) diff --git a/build.gradle b/build.gradle index 56a0bdf3..36d2ffca 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '1.6-SNAPSHOT' + id 'fabric-loom' version '1.7-SNAPSHOT' } apply from: 'https://raw.githubusercontent.com/TerraformersMC/GradleScripts/2.7/ferry.gradle' diff --git a/gradle.properties b/gradle.properties index 7a671c77..fb1af24c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,10 +3,10 @@ org.gradle.jvmargs=-Xmx1G maven_group=com.terraformersmc archive_name=modmenu -minecraft_version=1.21 -yarn_mappings=1.21+build.2 -loader_version=0.15.11 -fabric_version=0.100.1+1.21 +minecraft_version=24w34a +yarn_mappings=24w34a+build.8 +loader_version=0.16.2 +fabric_version=0.102.2+1.21.2 text_placeholder_api_version=2.4.0-pre.2+1.21 quilt_loader_version=0.17.7 @@ -21,14 +21,14 @@ default_release_type=stable # Modrinth Metadata modrinth_slug=modmenu modrinth_id=mOgUt4GM -modrinth_game_versions=1.21 +modrinth_game_versions=24w34a modrinth_mod_loaders=fabric, quilt modrinth_required_dependencies=fabric-api, placeholder-api # CurseForge Metadata curseforge_slug=modmenu curseforge_id=308702 -curseforge_game_versions=1.21, Fabric, Quilt +curseforge_game_versions=1.21.2-Snapshot, Fabric, Quilt curseforge_required_dependencies=fabric-api, text-placeholder-api curseforge_optional_dependencies= diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b82aa23a..a4413138 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/src/main/java/com/terraformersmc/modmenu/gui/ModsScreen.java b/src/main/java/com/terraformersmc/modmenu/gui/ModsScreen.java index 6d6f9430..e66a7bf6 100644 --- a/src/main/java/com/terraformersmc/modmenu/gui/ModsScreen.java +++ b/src/main/java/com/terraformersmc/modmenu/gui/ModsScreen.java @@ -24,6 +24,7 @@ import net.minecraft.client.gui.widget.ButtonWidget; import net.minecraft.client.gui.widget.ClickableWidget; import net.minecraft.client.gui.widget.TextFieldWidget; +import net.minecraft.client.render.RenderLayer; import net.minecraft.client.resource.language.I18n; import net.minecraft.client.toast.SystemToast; import net.minecraft.screen.ScreenTexts; @@ -407,7 +408,7 @@ public void render(DrawContext DrawContext, int mouseX, int mouseY, float delta) } RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.enableBlend(); - DrawContext.drawTexture(this.selected.getIconTexture(), x, RIGHT_PANE_Y, 0.0F, 0.0F, 32, 32, 32, 32); + DrawContext.drawTexture(RenderLayer::getGuiTextured, this.selected.getIconTexture(), x, RIGHT_PANE_Y, 0.0F, 0.0F, 32, 32, 32, 32); RenderSystem.disableBlend(); int lineSpacing = textRenderer.fontHeight + 1; int imageOffset = 36; diff --git a/src/main/java/com/terraformersmc/modmenu/gui/widget/DescriptionListWidget.java b/src/main/java/com/terraformersmc/modmenu/gui/widget/DescriptionListWidget.java index 5cc521ab..1c382f19 100644 --- a/src/main/java/com/terraformersmc/modmenu/gui/widget/DescriptionListWidget.java +++ b/src/main/java/com/terraformersmc/modmenu/gui/widget/DescriptionListWidget.java @@ -9,6 +9,7 @@ import com.terraformersmc.modmenu.util.mod.Mod; import net.minecraft.client.MinecraftClient; import net.minecraft.client.font.TextRenderer; +import net.minecraft.client.gl.ShaderProgramKeys; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.Element; import net.minecraft.client.gui.Selectable; @@ -289,7 +290,8 @@ public void renderList(DrawContext DrawContext, int mouseX, int mouseY, float de GlStateManager.SrcFactor.ZERO, GlStateManager.DstFactor.ONE ); - RenderSystem.setShader(GameRenderer::getPositionColorProgram); +// RenderSystem.setShader(GameRenderer::getPositionColorProgram); + RenderSystem.setShader(ShaderProgramKeys.POSITION_COLOR); bufferBuilder = tessellator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR); bufferBuilder.vertex(this.getX(), (this.getY() + 4), 0.0F). @@ -349,7 +351,6 @@ public void renderScrollBar(BufferBuilder bufferBuilder, Tessellator tessellator q = this.getY(); } - RenderSystem.setShader(GameRenderer::getPositionColorProgram); bufferBuilder = tessellator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR); bufferBuilder.vertex(scrollbarStartX, this.getBottom(), 0.0F).color(0, 0, 0, 255); bufferBuilder.vertex(scrollbarEndX, this.getBottom(), 0.0F).color(0, 0, 0, 255); diff --git a/src/main/java/com/terraformersmc/modmenu/gui/widget/LegacyTexturedButtonWidget.java b/src/main/java/com/terraformersmc/modmenu/gui/widget/LegacyTexturedButtonWidget.java index df81333d..c88ddbb8 100644 --- a/src/main/java/com/terraformersmc/modmenu/gui/widget/LegacyTexturedButtonWidget.java +++ b/src/main/java/com/terraformersmc/modmenu/gui/widget/LegacyTexturedButtonWidget.java @@ -3,6 +3,7 @@ import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.widget.ButtonWidget; import net.minecraft.client.gui.widget.TexturedButtonWidget; +import net.minecraft.client.render.RenderLayer; import net.minecraft.text.Text; import net.minecraft.util.Identifier; @@ -52,7 +53,7 @@ public void renderWidget(DrawContext context, int mouseX, int mouseY, float delt v += this.hoveredVOffset; } - context.drawTexture(this.texture, + context.drawTexture(RenderLayer::getGuiTextured, this.texture, this.getX(), this.getY(), this.u, diff --git a/src/main/java/com/terraformersmc/modmenu/gui/widget/ModListWidget.java b/src/main/java/com/terraformersmc/modmenu/gui/widget/ModListWidget.java index df695e8f..eeb7cfc2 100644 --- a/src/main/java/com/terraformersmc/modmenu/gui/widget/ModListWidget.java +++ b/src/main/java/com/terraformersmc/modmenu/gui/widget/ModListWidget.java @@ -12,6 +12,7 @@ import com.terraformersmc.modmenu.util.mod.ModSearch; import com.terraformersmc.modmenu.util.mod.fabric.FabricIconHandler; import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gl.ShaderProgramKeys; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.widget.AlwaysSelectedEntryListWidget; import net.minecraft.client.render.*; @@ -229,7 +230,7 @@ protected void renderList(DrawContext DrawContext, int mouseX, int mouseY, float entryLeft = getRowLeft() - 2 + entry.getXOffset(); int selectionRight = this.getRowLeft() + rowWidth + 2; float float_2 = this.isFocused() ? 1.0F : 0.5F; - RenderSystem.setShader(GameRenderer::getPositionProgram); + RenderSystem.setShader(ShaderProgramKeys.POSITION); RenderSystem.setShaderColor(float_2, float_2, float_2, 1.0F); Matrix4f matrix = DrawContext.getMatrices().peek().getPositionMatrix(); BuiltBuffer builtBuffer; @@ -245,7 +246,7 @@ protected void renderList(DrawContext DrawContext, int mouseX, int mouseY, float } catch (Exception e) { // Ignored } - RenderSystem.setShader(GameRenderer::getPositionProgram); + RenderSystem.setShader(ShaderProgramKeys.POSITION); RenderSystem.setShaderColor(0.0F, 0.0F, 0.0F, 1.0F); buffer = tessellator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION); buffer.vertex(matrix, entryLeft + 1, entryTop + entryHeight + 1, 0.0F); diff --git a/src/main/java/com/terraformersmc/modmenu/gui/widget/UpdateAvailableBadge.java b/src/main/java/com/terraformersmc/modmenu/gui/widget/UpdateAvailableBadge.java index 01e68b94..07489ef0 100644 --- a/src/main/java/com/terraformersmc/modmenu/gui/widget/UpdateAvailableBadge.java +++ b/src/main/java/com/terraformersmc/modmenu/gui/widget/UpdateAvailableBadge.java @@ -2,6 +2,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.render.RenderLayer; import net.minecraft.util.Identifier; import net.minecraft.util.Util; @@ -14,6 +15,6 @@ public static void renderBadge(DrawContext DrawContext, int x, int y) { if ((Util.getMeasuringTimeMs() / 800L & 1L) == 1L) { animOffset = 8; } - DrawContext.drawGuiTexture(UPDATE_ICON, x, y, 8, 8); + DrawContext.drawGuiTexture(RenderLayer::getGuiTextured, UPDATE_ICON, x, y, 8, 8); } } diff --git a/src/main/java/com/terraformersmc/modmenu/gui/widget/entries/ModListEntry.java b/src/main/java/com/terraformersmc/modmenu/gui/widget/entries/ModListEntry.java index 724b1bc1..2dfaffbe 100644 --- a/src/main/java/com/terraformersmc/modmenu/gui/widget/entries/ModListEntry.java +++ b/src/main/java/com/terraformersmc/modmenu/gui/widget/entries/ModListEntry.java @@ -13,6 +13,7 @@ import net.minecraft.client.font.TextRenderer; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.widget.AlwaysSelectedEntryListWidget; +import net.minecraft.client.render.RenderLayer; import net.minecraft.client.texture.NativeImageBackedTexture; import net.minecraft.text.StringVisitable; import net.minecraft.text.Text; @@ -69,7 +70,7 @@ public void render( } RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.enableBlend(); - DrawContext.drawTexture(this.getIconTexture(), x, y, 0.0F, 0.0F, iconSize, iconSize, iconSize, iconSize); + DrawContext.drawTexture(RenderLayer::getGuiTextured, this.getIconTexture(), x, y, 0.0F, 0.0F, iconSize, iconSize, iconSize, iconSize); RenderSystem.disableBlend(); Text name = Text.literal(mod.getTranslatedName()); StringVisitable trimmedName = name; @@ -133,7 +134,7 @@ public void render( DrawContext.fill(x, y, x + iconSize, y + iconSize, -1601138544); boolean hoveringIcon = mouseX - x < iconSize; if (this.list.getParent().modScreenErrors.containsKey(modId)) { - DrawContext.drawGuiTexture(hoveringIcon ? ERROR_HIGHLIGHTED_ICON : ERROR_ICON, + DrawContext.drawGuiTexture(RenderLayer::getGuiTextured, hoveringIcon ? ERROR_HIGHLIGHTED_ICON : ERROR_ICON, x, y, iconSize, @@ -149,7 +150,7 @@ public void render( } } else { int v = hoveringIcon ? iconSize : 0; - DrawContext.drawTexture(MOD_CONFIGURATION_ICON, + DrawContext.drawTexture(RenderLayer::getGuiTextured, MOD_CONFIGURATION_ICON, x, y, 0.0F, diff --git a/src/main/java/com/terraformersmc/modmenu/gui/widget/entries/ParentEntry.java b/src/main/java/com/terraformersmc/modmenu/gui/widget/entries/ParentEntry.java index b54f5499..6915a2b1 100644 --- a/src/main/java/com/terraformersmc/modmenu/gui/widget/entries/ParentEntry.java +++ b/src/main/java/com/terraformersmc/modmenu/gui/widget/entries/ParentEntry.java @@ -8,6 +8,7 @@ import com.terraformersmc.modmenu.util.mod.ModSearch; import net.minecraft.client.font.TextRenderer; import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.render.RenderLayer; import net.minecraft.text.Text; import net.minecraft.util.Identifier; import net.minecraft.util.Util; @@ -102,7 +103,7 @@ public void render( int xOffset = list.getParent().showModChildren.contains(getMod().getId()) ? iconSize : 0; int yOffset = hoveringIcon ? iconSize : 0; RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); - DrawContext.drawTexture(PARENT_MOD_TEXTURE, + DrawContext.drawTexture(RenderLayer::getGuiTextured, PARENT_MOD_TEXTURE, x, y, xOffset, From c532d3f62044347aa81944426164024452aaf342 Mon Sep 17 00:00:00 2001 From: Domi <1492543+FakeDomi@users.noreply.github.com> Date: Sun, 25 Aug 2024 18:43:38 +0200 Subject: [PATCH 2/5] Fix #757 (#764) - Improve compatibility with other mods' mixins --- .../java/com/terraformersmc/modmenu/mixin/MixinGameMenu.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/terraformersmc/modmenu/mixin/MixinGameMenu.java b/src/main/java/com/terraformersmc/modmenu/mixin/MixinGameMenu.java index e6d85189..58dd2e87 100644 --- a/src/main/java/com/terraformersmc/modmenu/mixin/MixinGameMenu.java +++ b/src/main/java/com/terraformersmc/modmenu/mixin/MixinGameMenu.java @@ -28,7 +28,7 @@ protected MixinGameMenu(Text title) { } @Inject(method = "initWidgets", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/widget/GridWidget;forEachChild(Ljava/util/function/Consumer;)V"), locals = LocalCapture.CAPTURE_FAILEXCEPTION) - private void onInitWidgets(CallbackInfo ci, GridWidget gridWidget, GridWidget.Adder adder, Text text) { + private void onInitWidgets(CallbackInfo ci, GridWidget gridWidget) { if (gridWidget != null) { final List buttons = ((AccessorGridWidget) gridWidget).getChildren(); if (ModMenuConfig.MODIFY_GAME_MENU.getValue()) { From 5b81c3a1b99740577eeee3d3690accc1706fcc69 Mon Sep 17 00:00:00 2001 From: haykam821 <24855774+haykam821@users.noreply.github.com> Date: Sun, 15 Sep 2024 16:32:39 -0400 Subject: [PATCH 3/5] Update mod to Minecraft snapshot 24w36a (#777) --- gradle.properties | 10 +++++----- src/main/resources/fabric.mod.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gradle.properties b/gradle.properties index fb1af24c..081ccb51 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,10 +3,10 @@ org.gradle.jvmargs=-Xmx1G maven_group=com.terraformersmc archive_name=modmenu -minecraft_version=24w34a -yarn_mappings=24w34a+build.8 -loader_version=0.16.2 -fabric_version=0.102.2+1.21.2 +minecraft_version=24w36a +yarn_mappings=24w36a+build.6 +loader_version=0.16.5 +fabric_version=0.104.0+1.21.2 text_placeholder_api_version=2.4.0-pre.2+1.21 quilt_loader_version=0.17.7 @@ -21,7 +21,7 @@ default_release_type=stable # Modrinth Metadata modrinth_slug=modmenu modrinth_id=mOgUt4GM -modrinth_game_versions=24w34a +modrinth_game_versions=24w36a modrinth_mod_loaders=fabric, quilt modrinth_required_dependencies=fabric-api, placeholder-api diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index e5c7997f..e4162411 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -25,7 +25,7 @@ "fabric-key-binding-api-v1": "*", "fabric-lifecycle-events-v1": "*", "fabricloader": ">=0.15.10", - "minecraft": ">=1.21-beta.2" + "minecraft": ">=1.21.2-" }, "authors": [ "Prospector", From 1e278cb32371539392dd46dd2d2fecb2ccb09027 Mon Sep 17 00:00:00 2001 From: gniftygnome <50962022+gniftygnome@users.noreply.github.com> Date: Sun, 13 Oct 2024 21:07:03 -0700 Subject: [PATCH 4/5] 1.21.2-pre1 update (#785) - Updated to 1.21.2-pre3 --- gradle.properties | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gradle.properties b/gradle.properties index 081ccb51..e305874c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,12 +3,12 @@ org.gradle.jvmargs=-Xmx1G maven_group=com.terraformersmc archive_name=modmenu -minecraft_version=24w36a -yarn_mappings=24w36a+build.6 -loader_version=0.16.5 -fabric_version=0.104.0+1.21.2 +minecraft_version=1.21.2-pre3 +yarn_mappings=1.21.2-pre3+build.2 +loader_version=0.16.7 +fabric_version=0.105.4+1.21.2 text_placeholder_api_version=2.4.0-pre.2+1.21 -quilt_loader_version=0.17.7 +quilt_loader_version=0.26.4 # Project Metadata project_name=Mod Menu @@ -21,7 +21,7 @@ default_release_type=stable # Modrinth Metadata modrinth_slug=modmenu modrinth_id=mOgUt4GM -modrinth_game_versions=24w36a +modrinth_game_versions=1.21.2-pre1, 1.21.2-pre1, 1.21.2-pre1 modrinth_mod_loaders=fabric, quilt modrinth_required_dependencies=fabric-api, placeholder-api From 92662d8c51dbd90c5084a8e462420d6e498359c4 Mon Sep 17 00:00:00 2001 From: Prospector Date: Sun, 13 Oct 2024 21:14:25 -0700 Subject: [PATCH 5/5] fix modrinth game versions --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index e305874c..b449d77c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,7 +21,7 @@ default_release_type=stable # Modrinth Metadata modrinth_slug=modmenu modrinth_id=mOgUt4GM -modrinth_game_versions=1.21.2-pre1, 1.21.2-pre1, 1.21.2-pre1 +modrinth_game_versions=1.21.2-pre1, 1.21.2-pre2, 1.21.2-pre3 modrinth_mod_loaders=fabric, quilt modrinth_required_dependencies=fabric-api, placeholder-api