Skip to content

Commit

Permalink
Update for 24w34a (1.21.2) (#772)
Browse files Browse the repository at this point in the history
- Update for 24w31a
  • Loading branch information
kel-cu authored Aug 25, 2024
1 parent bfa093d commit 9a12184
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 19 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
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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=

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 @@ -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;
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 @@ -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;
Expand All @@ -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);
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 @@ -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,
Expand All @@ -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,
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

0 comments on commit 9a12184

Please sign in to comment.