Skip to content

Commit

Permalink
Fix render errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Blast-MC committed Aug 8, 2023
1 parent c60bf7f commit 2179d82
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
10 changes: 5 additions & 5 deletions src/main/java/gg/projecteden/titan/mixin/OptionsScreenMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ public void drawSaturnUpdateChecker(CallbackInfo ci) {

this.addDrawableChild(updateSaturnButton);
if (updateAvailable) {
this.addDrawable((matrices, mouseX, mouseY, delta) -> {
this.addDrawable((context, mouseX, mouseY, delta) -> {
RenderSystem.setShaderTexture(0, UPDATE_AVAILABLE);
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
matrices.push();
matrices.scale(0.4F, 0.4F, 0.4F);
DrawContext.drawTexture(matrices, (int) ((this.width / 2 - 165) * 2.5), (int) ((this.height / 6 + 120 - 15) * 2.5), 0.0F, 0.0F, 9, 40, 9, 40);
matrices.pop();
context.getMatrices().push();
context.getMatrices().scale(0.4F, 0.4F, 0.4F);
context.drawTexture(UPDATE_AVAILABLE, (int) ((this.width / 2 - 165) * 2.5), (int) ((this.height / 6 + 120 - 15) * 2.5), 0.0F, 0.0F, 9, 40, 9, 40);
context.getMatrices().pop();
});
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package gg.projecteden.titan.mixin;

import gg.projecteden.titan.saturn.Saturn;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.SplashOverlay;
import net.minecraft.client.util.math.MatrixStack;
import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -16,7 +17,7 @@ public class SplashOverlayMixin {
private float progress;

@Inject(method = "renderProgressBar", at = @At("RETURN"))
private void start(MatrixStack matrices, int minX, int minY, int maxX, int maxY, float opacity, CallbackInfo ci) {
private void start(DrawContext matrices, int minX, int minY, int maxX, int maxY, float opacity, CallbackInfo ci) {
if (this.progress > 0.95F) {
for (Runnable runnable : Saturn.queuedProcesses)
runnable.run();
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/gg/projecteden/titan/mixin/TitleScreenMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private void addDirectServerButton(int y, int spacingY, CallbackInfo ci) {
}
});
} else if (TitanUpdater.updateStatus == UpdateStatus.NONE)
ConnectScreen.connect(this, MinecraftClient.getInstance(), ServerAddress.parse("projecteden.gg"), TitleScreenMixin.serverInfo);
ConnectScreen.connect(this, MinecraftClient.getInstance(), ServerAddress.parse("projecteden.gg"), TitleScreenMixin.serverInfo, false);
};
this.addDrawableChild(ButtonWidget.builder(Text.of(""), action).dimensions(this.width / 2 - 100 + 205, y + spacingY, 20, 20).build());
TexturedButtonWidget joinProjectEdenButton = new TexturedButtonWidget(this.width / 2 - 100 + 205, y + spacingY, 20, 20, 0, 0, 0, Titan.PE_LOGO, 20, 20, action, Text.of("Project Eden"));
Expand All @@ -90,13 +90,13 @@ private void addDirectServerButton(int y, int spacingY, CallbackInfo ci) {
y -= (spacingY / 2);
int finalY = y;
if (TitanUpdater.updateStatus != UpdateStatus.NONE) {
this.addDrawable((matrices, mouseX, mouseY, delta) -> {
this.addDrawable((context, mouseX, mouseY, delta) -> {
RenderSystem.setShaderTexture(0, UPDATE_AVAILABLE);
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
matrices.push();
matrices.scale(0.4F, 0.4F, 0.4F);
DrawContext.drawTexture(matrices, (int) ((TitleScreenMixin.this.width / 2 - 100 + 220) * 2.5), (int) ((finalY + spacingY + 5) * 2.5), 0.0F, 0.0F, 9, 40, 9, 40);
matrices.pop();
context.getMatrices().push();
context.getMatrices().scale(0.4F, 0.4F, 0.4F);
context.drawTexture(UPDATE_AVAILABLE, (int) ((TitleScreenMixin.this.width / 2 - 100 + 220) * 2.5), (int) ((finalY + spacingY + 5) * 2.5), 0.0F, 0.0F, 9, 40, 9, 40);
context.getMatrices().pop();
});
}
}
Expand Down

0 comments on commit 2179d82

Please sign in to comment.