This commit is contained in:
kirillsaint 2023-07-03 20:01:12 +06:00
parent 889e0b2c50
commit 04b1a8a3e5

View File

@ -1,6 +1,7 @@
package net.silentclient.client.mixin.mixins;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiIngame;
import net.minecraft.client.gui.ScaledResolution;
@ -16,13 +17,13 @@ import net.silentclient.client.mods.hud.BossBarMod;
import net.silentclient.client.mods.hud.ScoreboardMod;
import net.silentclient.client.mods.render.CrosshairMod;
import net.silentclient.client.mods.render.PackTweaksMod;
import net.silentclient.client.mods.render.TitlesMod;
import net.silentclient.client.mods.settings.RenderMod;
import net.silentclient.client.utils.ColorUtils;
import net.silentclient.client.utils.HUDCaching;
import org.lwjgl.opengl.GL11;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.*;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@ -109,8 +110,37 @@ public abstract class GuiInGameMixin extends Gui {
}
}
@ModifyConstant(method = "renderScoreboard", constant = @Constant(intValue = 553648127))
private int silent$fixTextBlending(int original) {
return -1;
@Redirect(method = "renderGameOverlay", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;scale(FFF)V", ordinal = 0))
public void changeScaleOfTitle(float x, float y, float z) {
if(Client.getInstance().getModInstances().getModByClass(TitlesMod.class).isEnabled()) {
float scale = (float) Client.getInstance().getSettingsManager().getSettingByClass(TitlesMod.class, "Scale").getValDouble();
GlStateManager.scale(x - 1 + scale, y - 1 + scale, z - 1 + scale);
}
}
@Redirect(method = "renderGameOverlay", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;scale(FFF)V", ordinal = 1))
public void changeScaleOfDescription(float x, float y, float z) {
if(Client.getInstance().getModInstances().getModByClass(TitlesMod.class).isEnabled()) {
float scale = (float) Client.getInstance().getSettingsManager().getSettingByClass(TitlesMod.class, "Scale").getValDouble();
GlStateManager.scale(x - 1 + scale, y - 1 + scale, z - 1 + scale);
}
}
@Redirect(method = "renderGameOverlay", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/FontRenderer;drawString(Ljava/lang/String;FFIZ)I", ordinal = 0))
private int cancelTitle(FontRenderer instance, String text, float x, float y, int color, boolean dropShadow) {
if(Client.getInstance().getModInstances().getModByClass(TitlesMod.class).isEnabled()) {
return instance.drawString(text, x, y, color, dropShadow);
} else {
return 0;
}
}
@Redirect(method = "renderGameOverlay", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/FontRenderer;drawString(Ljava/lang/String;FFIZ)I", ordinal = 1))
private int cancelDescription(FontRenderer instance, String text, float x, float y, int color, boolean dropShadow) {
if(Client.getInstance().getModInstances().getModByClass(TitlesMod.class).isEnabled()) {
return instance.drawString(text, x, y, color, dropShadow);
} else {
return 0;
}
}
}