fuck you matrixstack nobody ever liked you anyway
This commit is contained in:
parent
6e7d77dea3
commit
f41e477e28
15 changed files with 65 additions and 69 deletions
|
@ -8,8 +8,8 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||
|
||||
import me.kawaiizenbo.moonlight.module.ModuleManager;
|
||||
import me.kawaiizenbo.moonlight.ui.HUD;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.gui.hud.InGameHud;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
|
||||
@Mixin(InGameHud.class)
|
||||
public class InGameHudMixin {
|
||||
|
@ -18,9 +18,9 @@ public class InGameHudMixin {
|
|||
@Shadow private int scaledHeight;
|
||||
|
||||
@Inject(at = @At("TAIL"), method = "render")
|
||||
public void onRender (MatrixStack matrices, float tickDelta, CallbackInfo info)
|
||||
public void onRender (DrawContext drawContext, float tickDelta, CallbackInfo info)
|
||||
{
|
||||
if (ModuleManager.INSTANCE.getModuleByName("HUD").enabled) HUD.INSTANCE.renderHUD(matrices, scaledWidth, scaledHeight);
|
||||
if (ModuleManager.INSTANCE.getModuleByName("HUD").enabled) HUD.INSTANCE.renderHUD(drawContext, scaledWidth, scaledHeight);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@ import net.minecraft.client.gui.DrawContext;
|
|||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.screen.TitleScreen;
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
@ -37,13 +36,13 @@ public abstract class TitleScreenMixin extends Screen
|
|||
}
|
||||
|
||||
@Inject(at = @At("TAIL"), method = "render")
|
||||
private void clientTag(MatrixStack matrices, int mouseX, int mouseY, float delta, CallbackInfo info)
|
||||
private void clientTag(DrawContext drawContext, int mouseX, int mouseY, float delta, CallbackInfo info)
|
||||
{
|
||||
float f = this.doBackgroundFade ? (Util.getMeasuringTimeMs() - this.backgroundFadeStart) / 1000.0F : 1.0F;
|
||||
float g = this.doBackgroundFade ? MathHelper.clamp(f - 1.0F, 0.0F, 1.0F) : 1.0F;
|
||||
int l = MathHelper.ceil(g * 255.0F) << 24;
|
||||
|
||||
DrawContext.drawTextWithShadow(matrices, this.textRenderer, Moonlight.clientTag + " " + Moonlight.versionTag, 2, 2, 16777215 | l);
|
||||
drawContext.drawTextWithShadow(this.textRenderer, Moonlight.clientTag + " " + Moonlight.versionTag, 2, 2, 16777215 | l);
|
||||
}
|
||||
|
||||
@Inject(at = @At("TAIL"), method = "init")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue