From 1aa9d47288197413a35d70ef102eb16b12c467fd Mon Sep 17 00:00:00 2001 From: i509VCB Date: Fri, 29 May 2020 12:04:41 -0700 Subject: [PATCH] Use a Slice over the Shift.BEFORE by -6 (#644) * Use a Slice over the Shift.BEFORE by -6 This is much less prone to breakage and possibly more precise. * bump version --- fabric-rendering-v1/build.gradle | 2 +- .../fabricmc/fabric/mixin/client/rendering/MixinInGameHud.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fabric-rendering-v1/build.gradle b/fabric-rendering-v1/build.gradle index 252a6b1e9..9a1f26f41 100644 --- a/fabric-rendering-v1/build.gradle +++ b/fabric-rendering-v1/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-rendering-v1" -version = getSubprojectVersion(project, "1.1.0") +version = getSubprojectVersion(project, "1.1.1") dependencies { compile project(path: ':fabric-api-base', configuration: 'dev') diff --git a/fabric-rendering-v1/src/main/java/net/fabricmc/fabric/mixin/client/rendering/MixinInGameHud.java b/fabric-rendering-v1/src/main/java/net/fabricmc/fabric/mixin/client/rendering/MixinInGameHud.java index fe6ca9345..c3c296833 100644 --- a/fabric-rendering-v1/src/main/java/net/fabricmc/fabric/mixin/client/rendering/MixinInGameHud.java +++ b/fabric-rendering-v1/src/main/java/net/fabricmc/fabric/mixin/client/rendering/MixinInGameHud.java @@ -19,6 +19,7 @@ package net.fabricmc.fabric.mixin.client.rendering; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.Slice; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import net.minecraft.client.util.math.MatrixStack; @@ -28,7 +29,7 @@ import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback; @Mixin(InGameHud.class) public class MixinInGameHud { - @Inject(method = "render", at = @At(value = "RETURN", shift = At.Shift.BY, by = -6)) + @Inject(method = "render", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;color4f(FFFF)V"), slice = @Slice(from = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/PlayerListHud;render(Lnet/minecraft/client/util/math/MatrixStack;ILnet/minecraft/scoreboard/Scoreboard;Lnet/minecraft/scoreboard/ScoreboardObjective;)V"))) public void render(MatrixStack matrixStack, float tickDelta, CallbackInfo callbackInfo) { HudRenderCallback.EVENT.invoker().onHudRender(matrixStack, tickDelta); }