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
This commit is contained in:
i509VCB 2020-05-29 12:04:41 -07:00 committed by GitHub
parent 2521f6a319
commit 1aa9d47288
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-rendering-v1" archivesBaseName = "fabric-rendering-v1"
version = getSubprojectVersion(project, "1.1.0") version = getSubprojectVersion(project, "1.1.1")
dependencies { dependencies {
compile project(path: ':fabric-api-base', configuration: 'dev') compile project(path: ':fabric-api-base', configuration: 'dev')

View file

@ -19,6 +19,7 @@ package net.fabricmc.fabric.mixin.client.rendering;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Slice;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import net.minecraft.client.util.math.MatrixStack; import net.minecraft.client.util.math.MatrixStack;
@ -28,7 +29,7 @@ import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
@Mixin(InGameHud.class) @Mixin(InGameHud.class)
public class MixinInGameHud { 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) { public void render(MatrixStack matrixStack, float tickDelta, CallbackInfo callbackInfo) {
HudRenderCallback.EVENT.invoker().onHudRender(matrixStack, tickDelta); HudRenderCallback.EVENT.invoker().onHudRender(matrixStack, tickDelta);
} }