Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/1.21.2' into feat/update-sort
Browse files Browse the repository at this point in the history
  • Loading branch information
andantet committed Nov 5, 2024
2 parents 822db0d + 92662d8 commit 01d4ecc
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 21 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ 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=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
Expand All @@ -21,14 +21,14 @@ default_release_type=stable
# Modrinth Metadata
modrinth_slug=modmenu
modrinth_id=mOgUt4GM
modrinth_game_versions=1.21, 1.21.1
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

# CurseForge Metadata
curseforge_slug=modmenu
curseforge_id=308702
curseforge_game_versions=1.21, 1.21.1, Fabric, Quilt
curseforge_game_versions=1.21.2-Snapshot, Fabric, Quilt
curseforge_required_dependencies=fabric-api, text-placeholder-api
curseforge_optional_dependencies=

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/terraformersmc/modmenu/gui/ModsScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -386,7 +387,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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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).
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.*;
Expand Down Expand Up @@ -225,7 +226,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;
Expand All @@ -241,7 +242,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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -132,7 +133,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,
Expand All @@ -148,7 +149,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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 01d4ecc

Please sign in to comment.